Banner Logo

Be a part of the family: Connect, Receive Support,
Contribute, and Reap Abundant Rewards!

vendor shop page link is broken

WCMp Core

Tagged: 

Resolved
Viewing 7 reply threads
  • Author
    Posts
    • #129559
      Criss
      Participant

      I still need to resolve one big issue, but before that I need to fix this one: the vendor page link is broken (please view attachment).
      Any idea what is it caused by?

    • #129564

      Hello thank you for getting in touch with us ,

      It seems like there is some plugin/theme conflict. Just to be sure, disable all the plugins except WooCommerce and WCMp and check again.
      If the issue still exists, please switch to some default theme such as Twenty Sixteen and check again.
      Please do keep us posted so we can help you out.

    • #129622
      Criss
      Participant

      It looks like the problem is not a plugin but just one snippets I added because I wanted to redirect to my theme’s default company’s product page (which is the problem outlined in my previous post)

      // REDIRECTS TO SHOP, IN ORDER TO DISABLE DEFAULT VENDOR-SHOP PAGE 
      function my_page_template_redirect(){
      if( is_tax( 'dc_vendor_shop' ) ){
      $vendor_id = get_queried_object()->term_id;
      // Get vendor info
      $vendor = get_wcmp_vendor_by_term($vendor_id);
      if($vendor){
      $redirect_url = 'https://backstage.agendadelvolo.info/Azienda/'. $vendor->page_title .'/#products';
      wp_safe_redirect($redirect_url);
      exit();
      }}}
      add_action( 'template_redirect', 'my_page_template_redirect', 999 );
      Copy

      But something is wrong, because it should redirect to the products’ tab of my company (example). Can you please help me find out what is wrong in the snippet?

    • #129714

      Hi,
      Kindly use below code and test.

      function my_page_template_redirect() {
          if( is_tax( 'dc_vendor_shop' ) ) {
              $vendor_id = get_queried_object()->term_id;
              // Get vendor info
              $vendor = get_wcmp_vendor_by_term($vendor_id);
              if($vendor) {
                  $redirect_url = 'https://backstage.agendadelvolo.info/Azienda/'. $vendor->page_title .'/#products';
                  wp_redirect($redirect_url);
                  die;
              }
          }
      }
      add_action( 'template_redirect', 'my_page_template_redirect', 1 );
      Copy

      If above code will not work then please share a vide regarding the issue and also share the link where do you redirect.

      Regards,

    • #129734
      Criss
      Participant

      sorry but I’m not prepared to set a video at the moment.
      The problem is that my theme puts the products into a specific #products tab of each company, which has a URL like mydomain/cpt/company-slug/#products (example)
      But the problem is that (as in the image above) WCMP creates a URL like mydomain/vendor and then the user can choose the shop name.
      This is clearly a conflict with the redirect because instead of going to the company page (by theme) it goes to the vendor page (by WCMP)… in a way, it should be $redirect_url = ‘https://backstage.agendadelvolo.info/vendor/’. $vendor->page_title .’/#products’; but I don’t know how to code.
      I hope I clarified myself.

    • #129735
      Criss
      Participant

      sorry but I’m not prepared to set a video at the moment.
      The problem is that my theme puts the products into a specific #products tab of each company, which has a URL like mydomain/cpt/company-slug/#products (example)
      But the problem is that (as in the image above) WCMP creates a URL like mydomain/vendor and then the user can choose the shop name.
      This is clearly a conflict with the redirect because instead of going to the company page (by theme) it goes to the vendor page (by WCMP)… in a way, it should be $redirect_url = ‘https://backstage.agendadelvolo.info/vendor/’. $vendor->page_title .’/#products’; but I don’t know how to code.
      I hope I clarified myself.

    • #131184
      Criss
      Participant

      Sorry, can you follow up on this issue? I’m really stuck and I need to solve it.

    • #131219
      This reply has been marked as private.
Viewing 7 reply threads

The topic ‘vendor shop page link is broken’ is closed to new replies.