I just purchased Marketking. I'm setting up vendors and I see the checkbox that says "enable base site URL" for this vendor. I would prefer that all vendors have base site URL enabled by default. Is there a way to do this, or do I have to check the box manually for each vendor?
There isn't a built-in global setting for this, but you can enable it automatically for all vendors by adding this code snippet to your theme's functions.php or any code snippets plugin:
One thing to keep in mind: since these URLs appear directly on your site (e.g. site.com/vendorname), I'd recommend using Manual approval for new vendor registrations rather than Automatic. With automatic approval, anyone could register a vendor account with a store URL like "vip" or "promo", and that link would immediately go live on your site pointing to their store. With manual approval, you can review each store URL before it goes live.
Thank you so much! I'm new to code snippets but I'm excited to learn. I'm using WPCode... quick followup question: I'm assuming this should be a PHP snippet, correct? There are other options such as HTML/CSS/JS snippets, but I chose PHP for this one.
And thank you for the advice about manual approval. That is my plan moving forward. :-)
When I create a new user from the admin side, and then set them as a vendor, I still don't see the "enable base site URL" check box checked automatically. I did save and activate the snippet. But am I correct that this snippet will work correctly when vendors register from the front end?
Update: I tested registering a new vendor from the front end (with manual approval), and the base site URL options was already checked the new vendor account when using the code snippet. :-) Thanks!
I just purchased Marketking. I'm setting up vendors and I see the checkbox that says "enable base site URL" for this vendor. I would prefer that all vendors have base site URL enabled by default. Is there a way to do this, or do I have to check the box manually for each vendor?
Hi Jeff,
Thank you for purchasing our plugin!
There isn't a built-in global setting for this, but you can enable it automatically for all vendors by adding this code snippet to your theme's functions.php or any code snippets plugin:
add_filter( 'get_user_metadata', function( $value, $user_id, $meta_key, $single ) { if ( $meta_key === 'marketking_vendor_store_url_base' ) { return '1'; } return $value; }, 10, 4 );One thing to keep in mind: since these URLs appear directly on your site (e.g. site.com/vendorname), I'd recommend using Manual approval for new vendor registrations rather than Automatic. With automatic approval, anyone could register a vendor account with a store URL like "vip" or "promo", and that link would immediately go live on your site pointing to their store. With manual approval, you can review each store URL before it goes live.
Let me know if I can help with anything,
Kind regards,
Stefan
Thank you so much! I'm new to code snippets but I'm excited to learn. I'm using WPCode... quick followup question: I'm assuming this should be a PHP snippet, correct? There are other options such as HTML/CSS/JS snippets, but I chose PHP for this one.
And thank you for the advice about manual approval. That is my plan moving forward. :-)
When I create a new user from the admin side, and then set them as a vendor, I still don't see the "enable base site URL" check box checked automatically. I did save and activate the snippet. But am I correct that this snippet will work correctly when vendors register from the front end?
Update: I tested registering a new vendor from the front end (with manual approval), and the base site URL options was already checked the new vendor account when using the code snippet. :-) Thanks!