Disable Store Name via membership ID

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

This topic contains 5 replies, has 2 voices, and was last updated by WCFM Forum WCFM Forum 1 day, 6 hours ago.

  • Author
    Posts
  • #95687
    Avatar
    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
    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
    Avatar
    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
    WCFM Forum
    Keymaster

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

  • #96835
    Avatar
    PaulM
    Participant

    Yes, but only for this membership.

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

  • #97162
    WCFM Forum
    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.

You must be logged in to reply to this topic.