Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › Catalog mode
- This topic has 1 reply, 2 voices, and was last updated 5 years, 2 months ago by WCFM Forum.
Viewing 1 reply thread
- AuthorPosts
- October 2, 2019 at 10:45 am #84744PATselovParticipant
How to disable sales for all sellers and leave only catalog mode?
- October 11, 2019 at 9:33 am #86165WCFM ForumMember
Hi,
Add this code to your site, hence all products will be publish in “catalog mode” –
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 ); add_action( 'after_wcfm_products_manage_general', function( $product_id, $product_type ) { ?> <script> jQuery(document).ready(function($) { $('#wcfm_products_manage_form_catalog_head').remove(); }); </script> <?php }, 50, 2 );
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
- AuthorPosts
Viewing 1 reply thread
- The topic ‘Catalog mode’ is closed to new replies.