Disable Store Name via membership ID

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!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM Disable Store Name via membership ID

Viewing 5 reply threads
  • Author
    Posts
    • #95687
      PaulM
      Participant

      How can I disable the Store Name field for a membership. I´ve tried the wcfm_is_allow_store_name filter, but it doesnt work as it should

      add_filter( 'wcfm_is_allow_store_name', 'vendor_account' );
      
      function vendor_account( ) {
      	if (isset($_POST['membership']) && $_POST['membership'] == 4121) {
      		$content = '__return_false';
      	} else {
      		$content = '__return_true';
      	}
      	
      	return $content;
      }
    • #96396
      WCFM Forum
      Keymaster

      HI,

      Please use this revised code –

      add_filter( 'wcfm_is_allow_store_name', function( $is_allow ) {
      	$vendor_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );
      	$wcfm_membership_id = get_user_meta( $vendor_id, 'wcfm_membership', true );
      	if( $wcfm_membership_id && wcfm_is_valid_membership( $wcfm_membership_id ) ) {
      		if ( ( $wcfm_membership_id == 4121 ) || ( $wcfm_membership_id == '4121' ) ) {
      			$is_allow = false;
      		}
      	}
      	
      	return $is_allow;
      }, 600 );

      Thank You

    • #96640
      PaulM
      Participant

      I am sorry. I forget to say, that this is for new registration.

      your excample works only with existing wordpress user?

    • #96817
      WCFM Forum
      Keymaster

      Do you want to disable “Store Name” insert option from Registration form as well?

    • #96835
      PaulM
      Participant

      Yes, but only for this membership.

      the intention is to use dealership and private seller (without a store)

    • #97162
      WCFM Forum
      Keymaster

      OK, well this is not possible to disable “Store Name” insert for a particular membership during registration.

      But this can be handle later using Group capability. You may disable “Sold By” for a particular group.

Viewing 5 reply threads
  • The topic ‘Disable Store Name via membership ID’ is closed to new replies.