Claim your freedom to choose the perfect partner for your multi-vendor journey.

FREEDOM25

Celebrate the festive season by giving your marketplace a powerful lift!

FESTIVE20

5.0.0
Something big is coming for marketplace admins… MultiVendorX 5.0 is almost here. Are you ready?
Be the first to explore all the game-changing features!
Power your marketplace dreams with unbeatable Black Friday deals!

MVXBLACK30

Supercharge your marketplace vision with unstoppable Cyber Monday deals!

MVXCYBER30

Holiday cheer, bigger savings
Take 25% off-because your marketplace deserves a gift too.

happyholiday

How to set a redirect rule for vendor pages?

Resolved
Viewing 13 reply threads
  • Author
    Posts
    • #219465
      l.gan
      Participant

      Please help me with redirects.
      I’m using the old vendor page with the code:
      add_filter('mvx_load_default_vendor_store', '__return_true');
      The 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' );
    • #219483

      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.

      • #219510
        l.gan
        Participant
        This reply has been marked as private.
    • #219526

      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.

      • #219547
        l.gan
        Participant
        This reply has been marked as private.
    • #219548

      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.

      • #219549
        l.gan
        Participant

        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;
            }
        } );
        • #219731
          l.gan
          Participant

          This code creates redirects, but leads to errors in the dashboard and when adding to cart.

    • #219550

      Kindly give us some time to check this and get back to you accordingly.

    • #219735

      Can you please share in detail what errors are you getting on your end so that we can assist you accordingly.

    • #220037
      l.gan
      Participant
      This reply has been marked as private.
    • #220054

      Great to hear that the code works fine.

      Regarding issue with the slider banner, as shared earlier the flow is working fine on our end.
      So can you please share a site where the issue is recreated with the default theme and WooCommerce and MultiVendorX being activated. If possible please share the site url and temporary admin and FTP access of the site with us so that we can look into it and help you accordingly.
      Also while sharing the access don’t forget to mark your reply as private.

      • #220073
        l.gan
        Participant
        This reply has been marked as private.
    • #220074

      Thanks for sharing the access.
      Kindly give us some time to check this on your site and get back to you accordingly.

    • #220101

      We have checked the flow with the slider banner images in the vendor dashboard on your shared site. But did not face any such issue as mentioned by you. Kindly check the video here https://www.awesomescreenshot.com/video/27862042?key=ed238e08458a84b89755ff536f558def.

      So kindly check again carefully on your end and let us know if you need any further assistance from our end.

      • #220110
        l.gan
        Participant

        Thanks for your reply,

        You need to follow exactly what is in the video https://drive.google.com/file/d/1KZ3LWgM4ggDc7qZ6Tluad1YPUZwPZO8I/view?usp=sharing:

        1. install the slider.
        2. go to any child tab “store settings”.
        3. SAVE OPTIONS (you did not save tabs in your video).
        4. return to the tab with the slider – you will notice that it is reset.

        You missed the step: Saving value options in tabs.
        Please look at the time code 0:48.

    • #220111

      Kindly give us some time to check this again and get back to you accordingly.

    • #220120

      Thanks for sharing the detailed steps with us.
      We are finally able to recreate the issue on our end. We will add a fix for this in our future update. Till then you can keep track of the progress of the issue from here https://github.com/multivendorx/MultiVendorX/issues/751.

      Let us know if you need any further assistance from our end.

    • #220410

      We have added the fix for the issue with the vendor slidder banner image in our latest update. Kindly update the MultiVendorX plugin to the latest version and check the same on your end.

      • #220416
        l.gan
        Participant

        Thanks solved

    • #220417

      You are welcome.
      Also, it would be really great if you can give us a 5/5 review here: https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/reviews/#new-post.
      This would motivate the team further to do their job more efficiently.

Viewing 13 reply threads
  • The topic ‘How to set a redirect rule for vendor pages?’ is closed to new replies.
Shopping Cart
Scroll to Top