Banner Logo

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

how to change base “store slug” ?

WCMp Core

Resolved
Viewing 1 reply thread
  • Author
    Posts
    • #134545
      Criss
      Participant

      I have discussed this before, but let me start a new topic so that we can tackle the problem from a different perspective.

      I’m using a redirect function $redirect_url = ‘https://mydomain.info/cpt-name/’. $vendor->page_title .’/#product’;
      but it’s not pointing to the correct page because that is dynamic and I cannot determine the page id of the corresponding user.

      So, as a workaround, I think I could change the base slug https://mydomain.info/vendor/ into https://mydomain.info/cpt-name/ directly in the shop settings vendor slug.
      Please look at the image attached for a detailed explanation. Thank you

    • #134596

      @Criss, we can assit you with the redirect function, but you need to consult with your theme/plugin, whoever adding this cpt slug.

      Only they can fetch the URL from each user_id.

      Please ask them look into this code, as this code will always direct the user in your custom link, whenever they will click on vendor’s shop page :

      function my_page_template_redirect()
      { 
         if( is_tax( 'dc_vendor_shop' ) )
         {
                 $shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) );
             wp_safe_redirect($shop_page_url);
             exit();
         }
      }
      add_action( 'template_redirect', 'my_page_template_redirect', 999 );
      Copy
Viewing 1 reply thread

The topic ‘how to change base “store slug” ?’ is closed to new replies.