Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WC Marketplace › Hide store visibility settings from vendors
- This topic has 5 replies, 3 voices, and was last updated 5 years, 4 months ago by nict.
- AuthorPosts
- August 6, 2019 at 9:28 am #75442
- August 8, 2019 at 4:56 am #75707thiemann.kParticipant
Hey nict,
i solved that with a snippet, that modified the css, if a specific user role is logged on.
the easiest way to know which “class” is needed is with Chrome Inspector.
do you want to hide all settings, or only certain?
Hide all = https://ibb.co/WFHDMDj
Hide certain Block = https://ibb.co/nPYDt30
Hide associated checkbox = https://ibb.co/YjgSGGHAnd now my custom snippet-code:
add_action('wp_head', 'add_css_head'); function add_css_head() { if( current_user_can('wcfm_vendor') ) { ?> <style> // YOUR CUSTOM CSS CODE HERE // FOR EXAMPLE TO HIDE ALL div.store_address.store_visibility_wrap {display:none} </style> <?php } }
- August 8, 2019 at 11:42 am #75750nictParticipant
Hi thanks for the reply, yes the whole store visibility wrap, including it’s heading. Added it to Snippets but it’s not doing anything unfortunately.
- August 8, 2019 at 3:42 pm #75781thiemann.kParticipant
okay, i used now {visibility:hidden}
but the Header “business visibility setup” remains visible, because it is not assigned to a separate class.
With this code I hide the options. (ONLY FOR THE MEMBERSCHIP “wcfm_vendor”)
add_action('wp_head', 'add_css_head'); function add_css_head() { if( current_user_can('wcfm_vendor') ) { ?> <style> div.store_address.store_visibility_wrap {visibility:hidden} </style> <?php } }
ciao,
Karsten – dein-3d.com - August 9, 2019 at 1:11 pm #75948WCFM ForumMember
HI,
Thanks @thiemann.k
Well, most convenient way to disable this from vendor’s setting panel using this code snippet –
add_filter( 'wcfm_is_allow_store_visibility', '__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
- August 10, 2019 at 6:33 am #76024nictParticipant
Ah great thanks WCfM, that did the trick.
Thanks for trying to help Thiemann.k. Tried the snippet as you posted it but for some reason it just didn’t do it.
- AuthorPosts
- The topic ‘Hide store visibility settings from vendors’ is closed to new replies.