Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › Redirect shop manager page if user is logged off
Tagged: logged, my-account, redirect, registration, shop-manager, unlogged, user, vendor
- This topic has 11 replies, 3 voices, and was last updated 4 years, 2 months ago by Sarmistha Chakraborty.
- AuthorPosts
- January 22, 2020 at 3:01 am #103095contatoappParticipant
Hi. Currently on my Marketplace the /shop-manager/ link redirects an unlogged user to the my-account page. I’d like for it to redirect to the vendor registration page. Is that possible?
- January 22, 2020 at 1:12 pm #103169Sarmistha ChakrabortyKeymaster
Hello,
function custom_redirects() { $redirecturl = site_url().'/vendor-register'; if ( is_page( 'store-manager' ) && !is_user_logged_in() ) { //add the slug name of vendor store manager page wp_redirect( $redirecturl ); die; } } add_action( 'template_redirect', 'custom_redirects' );
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/
Thanks.
- January 24, 2020 at 2:08 am #103507contatoappParticipant
Hello. I’ve used Code Snippets to run the code but it’s not working.
I should use the code as is, right? /vendor-register is not my vendor registration page slug (because it’s translated) so I changed it to my actual slug but it still didn’t work.
Attachments:
You must be logged in to view attached files.- January 24, 2020 at 12:25 pm #103566Sarmistha ChakrabortyKeymaster
Hello,
Is your store manager slug represented as “store-manager”?
Can you share the site’s access with us? Then we can take a look into this requirement.Thanks.
- January 29, 2020 at 3:44 pm #104528Sarmistha ChakrabortyKeymaster
Hi,
We have checked the code in your site, the quotation was mistype. Kindly check.
Thanks.
- January 24, 2020 at 6:33 pm #103627contatoappParticipant
Hello. How can I get in direct contact with you so I can send you your access?
- January 27, 2020 at 11:28 am #104122Sarmistha ChakrabortyKeymasterThis reply has been marked as private.
- January 29, 2020 at 6:58 pm #104547contatoappParticipant
Hello. Thanks for the solution, it’s working just as expected now.
Thank you very much!
- February 5, 2020 at 11:11 am #105502Auhouse.ruParticipantThis reply has been marked as private.
- February 5, 2020 at 11:48 am #105507Sarmistha ChakrabortyKeymaster
Hello,
Your Vendor shop-manager page slug is “dashboard”. So modify this script
function custom_redirects() { $redirecturl = site_url().'/vendor-register'; if ( is_page( 'dashboard' ) && !is_user_logged_in() ) { //add the slug name of vendor store manager page wp_redirect( $redirecturl ); die; } } add_action( 'template_redirect', 'custom_redirects' );
Thanks.
- February 5, 2020 at 12:31 pm #105510Auhouse.ruParticipant
Thanks
- February 5, 2020 at 12:35 pm #105511Sarmistha ChakrabortyKeymaster
You are always welcome 🙂
Let me know if there’s anything else we can help you with.
Can we ask for a favor? Would you mind taking a few minutes to review our plugin at https://wordpress.org/support/plugin/wc-multivendor-marketplace/reviews/ and let others know about your 5 Star experience with WCFM Marketplace. Also, follow us on Twitter https://twitter.com/wcfmmp for more exciting news, important updates, and irresistible offers.
- AuthorPosts
- The topic ‘Redirect shop manager page if user is logged off’ is closed to new replies.