Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WC Vendors › store name
- This topic has 5 replies, 2 voices, and was last updated 4 years, 7 months ago by Sushobhan.
- AuthorPosts
- January 31, 2020 at 6:55 pm #104802ozkancolParticipant
can i do store name.. store#1, store#2, store#3,
outomatic name? - February 5, 2020 at 6:31 pm #105558SushobhanKeymaster
Hi,
Please add the following code for this purpose-add_action( 'wcfmmp_new_store_created', function( $member_id, $wcfmmp_settings ) { global $WCFM, $wpdb; $store_name = 'store#'.$member_id; $store_slug = "store-".$member_id; update_user_meta( $member_id, 'store_name', $store_name ); update_user_meta( $member_id, 'wcfmmp_store_name', $store_name ); $wcfmmp_settings['store_name'] = $store_name; update_user_meta( $member_id, 'wcfmmp_profile_settings', $wcfmmp_settings ); $wpdb->query( "UPDATE {$wpdb->prefix}users SET user_nicename = '{$store_slug}' WHERE ID = $member_id" ); }, 50, 2 ); add_filter( 'wcfm_is_allow_store_name', '__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
- February 7, 2020 at 4:20 am #105972ozkancolParticipant
Thankyou keymaster but some issue about when “Store Registration Settings>>Required Approval” thick ok
and register vendor form
store name is emailname like info@abc.com ..store name is info ? - April 7, 2020 at 11:32 pm #116497ozkancolParticipant
Hi.. an update this code not working .. can you check please @Sushobhan
add_action( ‘wcfmmp_new_store_created’, function( $member_id, $wcfmmp_settings ) {
global $WCFM, $wpdb;
$store_name = ‘store#’.$member_id;
$store_slug = “store-“.$member_id;
update_user_meta( $member_id, ‘store_name’, $store_name );
update_user_meta( $member_id, ‘wcfmmp_store_name’, $store_name );
$wcfmmp_settings[‘store_name’] = $store_name;
update_user_meta( $member_id, ‘wcfmmp_profile_settings’, $wcfmmp_settings );
$wpdb->query( “UPDATE {$wpdb->prefix}users SET user_nicename = ‘{$store_slug}’ WHERE ID = $member_id” );
}, 50, 2 );
add_filter( ‘wcfm_is_allow_store_name’, ‘__return_false’ );- April 9, 2020 at 12:53 pm #117168SushobhanKeymaster
Hi,
Can you give me some more information on this? Are you getting any errors? Or, is it not naming the stores as Store#NUM where NUM can be any positive integer.
In my local setup the code works as expected. So, I’m stuck until I get further information on this.
Thanks!
- February 10, 2020 at 12:03 pm #106373SushobhanKeymaster
Hi,
Are you checking this before approving the vendor? Once you approve the pending vendor, the store name and store slug will change automatically.
Thanks
- AuthorPosts
- You must be logged in to reply to this topic.