Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM › Disable Store Name via membership ID
- This topic has 5 replies, 2 voices, and was last updated 4 years, 3 months ago by WCFM Forum.
- AuthorPosts
- December 3, 2019 at 3:16 am #95687PaulMParticipant
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; }
- December 7, 2019 at 12:24 pm #96396WCFM ForumKeymaster
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
- December 9, 2019 at 2:08 am #96640PaulMParticipant
I am sorry. I forget to say, that this is for new registration.
your excample works only with existing wordpress user?
- December 10, 2019 at 9:45 am #96817WCFM ForumKeymaster
Do you want to disable “Store Name” insert option from Registration form as well?
- December 10, 2019 at 11:02 am #96835PaulMParticipant
Yes, but only for this membership.
the intention is to use dealership and private seller (without a store)
- December 12, 2019 at 9:19 am #97162WCFM ForumKeymaster
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.
- AuthorPosts
- The topic ‘Disable Store Name via membership ID’ is closed to new replies.