Tagged: product slider, shortcode
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.
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;
}