Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › How to set catalog mode globally?
- This topic has 3 replies, 2 voices, and was last updated 4 years, 10 months ago by WCFM Forum.
Viewing 3 reply threads
- AuthorPosts
- May 25, 2019 at 2:54 am #63665domsGuest
How do I force catalog mode to all vendors? Currently I dont want the add to cart feature to my site. Everyone must use catalog mode and I dont want my users to manually check the Catalog mode and hide add to cart. How do I do this globally?
- May 28, 2019 at 6:41 pm #64138WCFM ForumKeymaster
Hi,
Please add this code to your child theme’s functions.php –
add_filter( 'wcfm_product_manage_fields_general', function( $general_fields, $product_id, $product_type ) { if( isset( $general_fields['is_catalog'] ) ) { $general_fields['is_catalog']['dfvalue'] = 'yes'; } $general_fields = wcfm_hide_field( 'is_catalog', $general_fields ); return $general_fields; }, 150, 3 ); add_filter( 'wcfm_product_fields_catalog_options', function( $catalog_fields, $product_id, $product_type ) { if( isset( $catalog_fields['disable_add_to_cart'] ) ) { $catalog_fields['disable_add_to_cart']['dfvalue'] = 'yes'; } if( isset( $catalog_fields['disable_price'] ) ) { //$catalog_fields['disable_price']['dfvalue'] = 'yes'; } $general_fields = wcfm_hide_field( 'disable_add_to_cart', $general_fields ); //$general_fields = wcfm_hide_field( 'disable_price', $general_fields ); return $catalog_fields; }, 150, 3 );
If you do not have any child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/
Thank You
- May 28, 2019 at 11:18 pm #64185domsGuest
Thank, I will use snippets
- May 29, 2019 at 7:30 pm #64862WCFM ForumKeymaster
Welcome 🙂
- AuthorPosts
Viewing 3 reply threads
- The topic ‘How to set catalog mode globally?’ is closed to new replies.