Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WC Marketplace › Disable Vendor Change hopname and Shopslug
- This topic has 9 replies, 2 voices, and was last updated 4 years, 5 months ago by Patrick.
- AuthorPosts
- June 7, 2020 at 6:17 pm #139281PatrickParticipant
Hi, how can i make that vendors cannot change there shopname and slugname, only with a request to site admin? who should be able to do this
If vendor register he can make shopname, later not able to change - June 8, 2020 at 12:28 pm #139482Sarmistha ChakrabortyMember
Hello,
add_filter( 'body_class', function( $classes ) { $userid = get_current_user_id(); if(wcfm_is_vendor($userid)) { $classes = array_merge( $classes, array( 'vendor-dashboard' ) ); } return $classes; }); add_action('wp_footer',function(){ ?> <script type="text/javascript"> if( $('.vendor-dashboard #store_name').length > 0 ) { $('.vendor-dashboard #store_name').prop('readonly', true);; } if( $('.vendor-dashboard #store_slug').length > 0 ) { $('.vendor-dashboard #store_slug').prop('readonly', true);; } </script> <?php });
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.
- June 8, 2020 at 4:04 pm #139569PatrickParticipant
Sorry, this code does not working
- June 8, 2020 at 10:43 pm #139708Sarmistha ChakrabortyMember
Please clear browser cache and check again.
Thanks.
- June 9, 2020 at 2:37 pm #139859PatrickParticipant
Hi I try everything clear browser cashe, copy your code again and vendor can change shopname, i need this because vendor do not allowed change shopname and slug
if a vendor goes to dashboard slug is https://.www.domain.name/store-manager/settings/
- June 9, 2020 at 8:14 pm #139954Sarmistha ChakrabortyMember
Hello,
Please provide us the site access with site URL, so we can check.
Thanks.
- June 9, 2020 at 8:34 pm #139958PatrickParticipantThis reply has been marked as private.
- June 9, 2020 at 8:36 pm #139959PatrickParticipant
is it ok like this? as private?
- June 10, 2020 at 1:47 pm #140214Sarmistha ChakrabortyMember
Hi,
Please check again and confirm.
Thanks.
- June 10, 2020 at 5:21 pm #140284PatrickParticipant
Perfect Thanks!!!!!!!
- AuthorPosts
- You must be logged in to reply to this topic.