Forum Replies Created
- AuthorPosts
- November 14, 2019 at 8:45 am in reply to: how to disable (or make private) vendor-groups page #92242systemParticipant
plus last post :
not use wild domain settings in your wordpress site.
you need add all available domains in your wordpress site(like: domain.com http://www.domain.com sub.domain.com) to the $current_url conditions.
if some domains pass the condition ( stripos($current_url, home_url(‘vendor-groups/’)) === 0 ) , the code will be useless!November 14, 2019 at 8:33 am in reply to: how to disable (or make private) vendor-groups page #92241systemParticipantthe code for the shortcode is to disable the vendor’s info to public, not to disable the vendor-groups.
here is my code to disable the vendor-groups endpoints :
// ====================
//diable wcfm endpoints : store, vendor-groups
$current_url = ( is_ssl() ? ‘https://’ : ‘http://’ ) . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’];
if( stripos($current_url, home_url(‘store/’)) === 0 or stripos($current_url, home_url(‘vendor-groups/’)) === 0 ) {
if ( wp_redirect( home_url() ) ) {
exit;
}
}// ====================
total proccess to disable all vendor’s info to public frontend and vendor’s role:
1. disable and hide store sidebar, vendor sidebar and vendor’s info fields(name/tel/email/address/etc.) at marketplace settings & store settings & Capability settings.
2. use this free plugin( https://wordpress.org/plugins/wp-widget-disable/ ) to disable all wcfm widgets(marketplace & store & vendor).
3. use remove_shortcode() function as following code in theme’s functions.php :
// —————-
add_action( ‘init’, ‘remove_wcfm_shortcodes’,9999 );
function remove_wcfm_shortcodes() {
remove_shortcode( ‘wcfm_store_info’ );
remove_shortcode( ‘wcfm_inquiry’ );
remove_shortcode( ‘wcfm_follow’ );
remove_shortcode( ‘wcfm_store_fb_feed’ );
remove_shortcode( ‘wcfm_store_twitter_feed’ );
remove_shortcode( ‘wcfm_stores’ );
remove_shortcode( ‘wcfm_store_hours’ );
}
// —————-
4. disable all endpoint begin with /store/ and /vendor-groups/ links.
//diable wcfm endpoints : store, vendor-groups
// —————-
$current_url = ( is_ssl() ? ‘https://’ : ‘http://’ ) . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’];
if( stripos($current_url, home_url(‘store/’)) === 0 or stripos($current_url, home_url(‘vendor-groups/’)) === 0 ) {
if ( wp_redirect( home_url() ) ) {
exit;
}
}
// —————-
hope it is useful for you and another b2b users.systemParticipantI have thinked out a proccess to disable all vendor’s info to public frontend and vendor’s role:
1. disable and hide store sidebar, vendor sidebar and vendor’s info fields(name/tel/email/address/etc.) at marketplace settings & store settings & Capability settings.
2. use this free plugin( https://wordpress.org/plugins/wp-widget-disable/ ) to disable all wcfm widgets(marketplace & store & vendor).
3. use remove_shortcode() function as following code in theme’s functions.php :
// —————-
add_action( ‘init’, ‘remove_wcfm_shortcodes’,9999 );
function remove_wcfm_shortcodes() {
remove_shortcode( ‘wcfm_store_info’ );
remove_shortcode( ‘wcfm_inquiry’ );
remove_shortcode( ‘wcfm_follow’ );
remove_shortcode( ‘wcfm_store_fb_feed’ );
remove_shortcode( ‘wcfm_store_twitter_feed’ );
remove_shortcode( ‘wcfm_stores’ );
remove_shortcode( ‘wcfm_store_hours’ );
}
// —————-
4. disable all endpoint begin with /store/ and /vendor-groups/ links.I think it will be work and I am trying the step 4 for now.
hope it is useful for you and another b2b users.
systemParticipant+1
I need this too.
Our B2B marketplace need hide the (Our Customers)vendor’s info for business safty requirement.
Most B2B Customers(as vendor role in marketplace) require to not public theirs info to public.I write an additional action to disable these links for no-admin now.
I hope there will be a option in backend to disable to vendor’s list page and shop page in wcfm-u or wcfm, or just use a shortcode page endpoint hold it for free usage.
You code is great, Hope you to be better.
Thanks. - AuthorPosts