Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Ultimate › Store Slug And Limiting Store Slug Changes
- This topic has 7 replies, 2 voices, and was last updated 4 years, 6 months ago by WCFM Forum.
- AuthorPosts
- August 21, 2019 at 9:44 am #77621officialParticipant
1. How can I delete the “-” character in the new vendor registration form? For example: Store name “Ex Store” will produce “domain.com/slug/ex-store”.
2. How can I limit the replacement of the store slug in the vendor settings dashboard? For example: it can only be replaced once.Thank You
Attachments:
You must be logged in to view attached files. - August 22, 2019 at 5:14 pm #77831WCFM ForumKeymaster
Hi,
Please add this code to your site –
add_filter( 'wcfm_generated_store_slug', function( $store_slug ) { $store_slug = str_replace( '-', '', $store_slug ); return $store_slug; }); add_filter( 'wcfm_is_allow_store_slug', '__return_false' );
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/Thank You
- August 24, 2019 at 3:41 am #78090officialParticipant
Then when the vendor changes the membership plan, they can change the store slug again (following the store name).
So how can I remove the Store Name field from the membership plan? But is the Store Name in the vendor settings NOT REMOVED?
- August 29, 2019 at 11:40 am #78938WCFM ForumKeymaster
Hi,
Well, you asked me code for removing “Store Slug”, do you want to remove “Store Name” as well?
Between, this code will applicable on all membership plans.
Thank You
- September 3, 2019 at 1:49 am #79735officialParticipant
Okay, send your code.
- September 4, 2019 at 8:34 am #79954WCFM ForumKeymaster
HI,
Use this code –
add_filter( 'wcfm_is_allow_store_name', '__return_false' );
Thank You
- September 5, 2019 at 2:19 am #80137officialParticipant
When I use the code, new vendors cannot enter the store name (First register).
So what I mean is: That vendors have registered on my site, they can’t change the store name when they want to increase / change store membership.
- September 6, 2019 at 4:41 pm #80442WCFM ForumKeymaster
HI,
Please use this updated code –
add_filter( 'wcfm_is_allow_store_name', function( $is_allow ) { if( is_user_logged_in() ) $is_allow = false; return $is_allow; });
Thank You
- AuthorPosts
- You must be logged in to reply to this topic.