MultivendorX
-
AuthorPosts
-
-
May 2, 2024 at 10:24 AM #219465l.ganParticipant
Please help me with redirects.
I’m using the old vendor page with the code:add_filter('mvx_load_default_vendor_store', '__return_true');
CopyThe vendor’s store page is located at
https://.com/seller/nike/But there are also child pages there, as I understand they are generated by the plugin
https://.com/seller/nike/reviews/
https://.com/seller/nike/policies/Do I need to redirect from these two pages reviews/ and policies/ to the vendor page? those. at https://.com/seller/nike/?
I’m not good at PHP, but the code does not redirect the URL. Could you help me with this?
function custom_taxonomy_redirects() { add_rewrite_rule( '^seller/([^/]+)/reviews/?$', 'index.php?dc_vendor_shop=$matches[1]&redirect=1', 'top' ); add_rewrite_rule( '^seller/([^/]+)/policies/?$', 'index.php?dc_vendor_shop=$matches[1]&redirect=1', 'top' ); } add_action('init', 'custom_taxonomy_redirects'); function do_custom_taxonomy_redirect() { if ( get_query_var( 'redirect' ) == 1 ) { $term_slug = get_query_var( 'dc_vendor_shop' ); $term_link = get_term_link( $term_slug, 'dc_vendor_shop' ); wp_redirect( $term_link, 301 ); exit; } } add_action( 'template_redirect', 'do_custom_taxonomy_redirect' );
Copy -
May 2, 2024 at 12:29 PM #219483Sangita Support SquadKeymaster
Hello @l.gan, Presently, users have seamless access to reviews, policies, and product pages directly from the vendor store page.
Could you specify the desired workflow on your end? This will help us to assist you accordingly. -
May 3, 2024 at 4:30 PM #219526Sangita Support SquadKeymaster
Hello There, Thanks for explaining your requirements to us. Our replies are inline –
1)For your required flow, you will have to add custom code on your end to redirect the users from the vendor review or the policy page to the vendor store page.
2) We have checked this on our end but did not face any such issue mentioned by you. Kindly check the video here https://www.awesomescreenshot.com/video/27313237?key=5a8953f498a0169a6f81e6ae696c7ce5.
It seems there might be some plugin conflict on your end. Just to be sure, deactivate all plugins except WooCommerce and MultiVendorX and check the flow again.
Let us know if you need any further assistance from our end. -
May 4, 2024 at 10:41 PM #219548Sangita Support SquadKeymaster
Hi there, thanks for getting back to us. Our replies are inline –
2) We will check the issue on your shared site and get back to you accordingly.
1) To be very honest currently we do not have any readymade code on our end for the customisation that you are looking for on your end. However, our team will check this and assist you accordingly to achieve your required flow.
But please note, the replies might get delayed as we are closed during the weekends.-
May 4, 2024 at 11:03 PM #219549l.ganParticipant
Thank you Sangita
1. I think this code helped me, but I’m not sure if it’s correct.
add_action( 'template_redirect', function() { if ( preg_match( '#^/seller/([^/]+)/(reviews|policies)/?$#i', $_SERVER['REQUEST_URI'], $matches ) ) { $term_slug = $matches[1]; $redirect_url = home_url( '/seller/' . $term_slug ); wp_redirect( $redirect_url, 301 ); exit; } } );
Copy
-
-
May 4, 2024 at 11:19 PM #219550Sangita Support SquadKeymaster
Kindly give us some time to check this and get back to you accordingly.
-
May 8, 2024 at 7:50 PM #219735Sangita Support SquadKeymaster
Can you please share in detail what errors are you getting on your end so that we can assist you accordingly.
-
May 19, 2024 at 12:25 AM #220037l.ganParticipantThis reply has been marked as private.
-
-
AuthorPosts
Please LOGIN to reply to this topic