Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WC Lovers

    (@wclovers)

    Hi,

    Sure, WCFM has catalog module for this – https://wclovers.com/knowledgebase/wcfm-catalog-mode/

    If you want to set all site products in auto-catalog mode, we can give a code snippet for that as well.

    Thank You

    Thread Starter droonss

    (@droonss)

    Thanks for the quick response.
    Tell me where can I request the code?

    Plugin Author WC Lovers

    (@wclovers)

    Hi,

    Here is that code –

    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.phpIn case you do not have child theme then add code using this plugin – https://ww.wp.xz.cn/plugins/code-snippets/

    Thank You

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Catalog mode?’ is closed to new replies.