Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WC Vendors › CHANGE STORE NAME TO LAST NAME AND FIRST NAME OF THE VENDOR
Tagged: Store Name
- This topic has 3 replies, 2 voices, and was last updated 4 years, 7 months ago by Sushobhan.
- AuthorPosts
- May 2, 2020 at 5:48 am #125602karl.deligeroParticipant
Hi,
I want to change the store name to the Last Name and First Name of the vendor.
It is possible?
Thank you
- May 2, 2020 at 12:36 pm #125646SushobhanKeymaster
Hi,
Thanks for getting in touch with us!
Yes, that’s absolutely possible. Please use the following snippet-add_action( 'wcfmmp_new_store_created', function( $vendor_id, $wcfmmp_settings ) { global $wpdb; $store_user = get_user_by( 'id', $vendor_id ); $first_name = $store_user->first_name; $last_name = $store_user->last_name; if ( $first_name || $last_name ) { $store_name = trim( "{$first_name} {$last_name}" ); $store_slug = sanitize_title( wc_clean( $store_name) ); update_user_meta( $vendor_id, 'store_name', $store_name ); update_user_meta( $vendor_id, 'wcfmmp_store_name', $store_name ); $wcfmmp_settings['store_name'] = $store_name; update_user_meta( $vendor_id, 'wcfmmp_profile_settings', $wcfmmp_settings ); $wpdb->query( "UPDATE {$wpdb->prefix}users SET user_nicename = '{$store_slug}' WHERE ID = $vendor_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/
Let me know how this goes.
Thanks! - May 2, 2020 at 2:22 pm #125671karl.deligeroParticipant
Hi,
Thank for the quick response. It Works 🙂
Thank you
- May 2, 2020 at 4:08 pm #125694SushobhanKeymaster
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 (if you haven’t already) 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
- You must be logged in to reply to this topic.