Hide store visibility settings from vendors

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 WC Marketplace Hide store visibility settings from vendors

Viewing 5 reply threads
  • Author
    Posts
    • #75442
      nict
      Participant

      I would like to hide the Store Visibility Settings from the vendors so that they can not change those settings to affect their details display. How can that be achieved please?

      Attachments:
      You must be logged in to view attached files.
    • #75707
      thiemann.k
      Participant

      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/YjgSGGH

      And 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
         }
      }
    • #75750
      nict
      Participant

      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.

    • #75781
      thiemann.k
      Participant

      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

    • #75948
      WCFM Forum
      Member

      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

    • #76024
      nict
      Participant

      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.

Viewing 5 reply threads
  • The topic ‘Hide store visibility settings from vendors’ is closed to new replies.