store name

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Viewing 2 reply threads
  • Author
    Posts
    • #104802
      ozkancol
      Participant

      can i do store name.. store#1, store#2, store#3,
      outomatic name?

    • #105558
      Sushobhan
      Keymaster

      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

      • #105972
        ozkancol
        Participant

        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 ?

      • #116497
        ozkancol
        Participant

        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’ );

        • #117168
          Sushobhan
          Keymaster

          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!

    • #106373
      Sushobhan
      Keymaster

      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

Viewing 2 reply threads
  • You must be logged in to reply to this topic.