Default check "Catalogue"

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!

Viewing 17 reply threads
  • Author
    Posts
    • #132481
      Guigs
      Participant

      Hello,
      I have used the following code to disable the Downloadable and Virtual options from the vendors store manager :

      function disable_virtual_downloadable_support( $general_fields ) {
          if ( isset( $general_fields['is_virtual'] ) )
              unset( $general_fields['is_virtual'] );
          if ( isset( $general_fields['is_downloadable'] ) )
              unset( $general_fields['is_downloadable'] );
          return $general_fields;
      }
      
      add_filter( 'wcfm_product_manage_fields_general', 'disable_virtual_downloadable_support' );

      Is there a way to default check the box “Catalog” now? I need to make my platform the easiest way to use possible…

      Thanks!

    • #132541
      Sushobhan
      Keymaster

      Hi,
      To disable virtual and downloadable from vendor dashboard go to your WCFM admin dashboard >> Capability, and from there disable both Virtual and Downloadable under Types section. See here- https://imgur.com/s78BLE2 **No need to do it using code**
      Also to enable Catalog by default, add the following snippet-

      add_filter( 'wcfm_product_manage_fields_general', function($general_fields, $product_id) {
          $is_catalog = ( get_post_meta( $product_id, '_catalog', true ) == 'no' ) ? 'no' : 'yes';
          if(isset($general_fields['is_catalog'])) {
              $general_fields['is_catalog']['dfvalue'] = $is_catalog;
          }
          return $general_fields;
      }, 101, 5 );

      Add this code to your child theme’s functions.php
      In case you do not have a child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/
      Let me know how this goes.
      Thanks!

    • #132984
      Guigs
      Participant

      Thank you very much it works!

      I don’t have these options letting me disable Virtual and Downloadable so I’ll use the code…

      Thanks!

    • #133007
      Sushobhan
      Keymaster

      Hi,

      I don’t have these options letting me disable Virtual and Downloadable so I’ll use the code…

      Are you using WCFM Groups & Staffs addon, in that case, these options are getting overridden by group capability settings. Otherwise, it should work. I can debug it further if you want.
      Just let me know.
      Thank You!

    • #133464
      Guigs
      Participant

      Hi, no I am not using this addon…
      Could my problem be linked to this ?
      https://wclovers.com/forums/topic/how-to-completely-delete-wp-hide-security-enhancer/

    • #133514
      Guigs
      Participant

      (Apparently no)

    • #133840
      web-3134
      Participant

      Hello,
      is it possible to set catalog mode only for a specific membership and normal (sell available) to others?

    • #134861
      Guigs
      Participant

      Hello,
      Is there a way to simply disable the 3 boxes, including catalog?

      Thank you…

    • #135031
      Sushobhan
      Keymaster

      Hi @web-3134,
      Correct me if I’m wrong, you want to keep the Catalog checkbox as it is and only makes it enabled by default for a particular membership. If I’m right, then use the following snippet for this-

      add_filter( 'wcfm_product_manage_fields_general', function($general_fields, $product_id) {
          if ( wcfm_get_membership() == 26 ) { // replace 26 with the actual membership id
              $is_catalog = ( get_post_meta( $product_id, '_catalog', true ) == 'no' ) ? 'no' : 'yes';
              if ( isset( $general_fields['is_catalog'] ) ) {
                  $general_fields['is_catalog']['dfvalue'] = $is_catalog;
              }
          }
          return $general_fields;
      }, 101, 5 );

      Add this code to your child theme’s functions.php
      In case you do not have a child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/
      Let me know how this goes.
      Thanks!
      n.b.- To get membership id of a plan, go to Memberships page and edit that membership, the number at the end of the URL is the membership id.

      • #135090
        web-3134
        Participant

        Hi @Sushobhan,

        that is exactly what I needed, now I can set “catalog mode” as default for Base Membership and let “normal mode” for all other memberships.

        Thank you!

    • #135032
      Sushobhan
      Keymaster

      Hi @Guigs,
      Last time you told me the code worked. What happened now? Have you changed anything? Or is it just stopped working?
      Let me know.
      Thank You!

    • #135047
      Guigs
      Participant

      Hi Sushobhan, I actually never found a code allowing me to disable the three of them, but the other ones worked.
      Would you be able to give me the one I need?

    • #135076
      Sushobhan
      Keymaster

      Hi,
      Kindly replace the code you were using to hide Virtual and Downloadable checkbox with the following, it will hide all 3 checkboxes Virtual, Downloadable, and Catalog-

      function disable_virtual_downloadable_support( $general_fields ) {
          if ( isset( $general_fields['is_virtual'] ) )
              unset( $general_fields['is_virtual'] );
          if ( isset( $general_fields['is_downloadable'] ) )
              unset( $general_fields['is_downloadable'] );
          if ( isset( $general_fields['is_catalog'] ) )
              unset( $general_fields['is_catalog'] );
          return $general_fields;
      }
      
      add_filter( 'wcfm_product_manage_fields_general', 'disable_virtual_downloadable_support' );

      Thank You!

    • #135175
      Guigs
      Participant

      Thank you but it hasn’t worked… :/
      I disabled the other snippets I was using (disabling Virtual and Downloadable, default checking Catalog), added this code in a new snippet, but it didn’t work.
      Now I’ve got the catalog box only, unchecked.

    • #135271
      Sushobhan
      Keymaster

      Hi,
      Sorry about that, I forget to mention the priority in my last code. Please use the following, its all the same just with the added priority of ‘101’ (anything above 100 will work in this case)-

      function disable_virtual_downloadable_support( $general_fields ) {
          if ( isset( $general_fields['is_virtual'] ) )
              unset( $general_fields['is_virtual'] );
          if ( isset( $general_fields['is_downloadable'] ) )
              unset( $general_fields['is_downloadable'] );
          if ( isset( $general_fields['is_catalog'] ) )
              unset( $general_fields['is_catalog'] );
          return $general_fields;
      }
      
      add_filter( 'wcfm_product_manage_fields_general', 'disable_virtual_downloadable_support', 101 );

      Thank You and Sorry again for the inconvenience.

    • #135337
      Guigs
      Participant

      Thank you so much ! 🙂

    • #135363
      Sushobhan
      Keymaster

      You are always welcome 🙂
      Let me know if there’s anything else we can help you with.
      Can we ask for a favor? Would you mind taking a few minutes to review our plugin (if you haven’t already) at https://wordpress.org/support/plugin/wc-multivendor-marketplace/reviews/ and let others know about your 5 Star experience with WCFM Marketplace. Also, follow us on Twitter https://twitter.com/wcfmmp for more exciting news, important updates, and irresistible offers.

    • #135377
      Guigs
      Participant

      Thank you, I promise I will (review).

      If there’s a way for you to help me with this matter, it would be amazing : https://wclovers.com/forums/topic/how-to-dissociate-payment-type-and-delivery-pick-up-and-let-the-vendors-choose

    • #136213
      Guigs
      Participant

      Oh I’ve got an issue… I though disabling “Catalog” for all products would erase the “Catalog Mode” menu when vendors add a new product.
      Is there a way to make this menu disappear?

Viewing 17 reply threads
  • You must be logged in to reply to this topic.