Catalog mode

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 1 reply thread
  • Author
    Posts
    • #84744
      PATselov
      Participant

      How to disable sales for all sellers and leave only catalog mode?

    • #86165
      WCFM Forum
      Member

      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

Viewing 1 reply thread
  • The topic ‘Catalog mode’ is closed to new replies.