Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #897460

    Hi all,
    in a shop build with Enfold and WooCommerce I use the Product Slider on the homepage. The shop hosts standard and seasonal products. Those seasonal products, which are currently not available are set to not available.

    I already managed to find code, which excludes those from the standard shop view, but they still appear in Enfolds Product Slider.

    Is there any way to hook in with add_action or do I need to copy the productslider.php to the childs shortcode-folder and modify the file hardcoded?

    Thank You.

    • This topic was modified 6 years, 10 months ago by mailworm.
    #897527
    add_filter('avia_product_slide_query', 'avia_product_slide_query_mod', 10, 1);
    function avia_product_slide_query_mod($params) {
    	if ($outofstock_term = get_term_by('name', 'outofstock', 'product_visibility')) {
    		$tax_query = (array) $params['tax_query'];
    		$tax_query[] = array(
    			'taxonomy' => 'product_visibility',
    			'field' => 'term_taxonomy_id',
    			'terms' => array($outofstock_term->term_taxonomy_id),
    			'operator' => 'NOT IN'
    		);
    		$params['tax_query'] = $tax_query;
    	}
    	return $params;
    }
    • This reply was modified 6 years, 10 months ago by mailworm.
    #897871

    Hi,

    Great, glad you got it working and thanks for sharing the solution :-)

    Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.