Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,
    Yes you can easily achieve this by adding following code in your functions.php file.

    add_filter('wfs_get_products_args', 'itsmeleo_update_shortcode_args');
    function itsmeleo_update_shortcode_args($args) {
    	global $shortcode_args;
    	$args['tax_query'] =
    	array(
    		array(
    			'taxonomy' => 'product_visibility',
    			'field' => 'name',
    			'terms' => 'exclude-from-catalog',
    			'operator' => 'NOT IN',
    		),
    	);
    	return $args;
    }
    Thread Starter itsmeleo

    (@itsmeleo)

    Hello,
    I think you are right and have the right concerns it’s personal preferences, so what is did more I remove my code from the files and created the following filter

    add_filter(‘wfs_get_products_args’, ‘itsmeleo_update_shortcode_args’);
    function itsmeleo_update_shortcode_args($args) {
    global $shortcode_args;
    $args[‘post_type’] = $shortcode_args[‘post_type’];
    $args[‘posts_per_page’] = $shortcode_args[‘posts_per_page’];
    return $args;
    }
    I think this is the correct way it won’t override if I update the plugin

    Thanks & Regards
    Itsmeleo

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