I have tried myself to include a filter that prevents / skips the output of products that have no value or a value lower than the value specified at the variable MinSavingPercent. Unfortunately, AT is too complex for me to get my head around. 😉
So that you can filter products by price discount in a list, you can use this filter. We filter for at least 40% off in this example.
Also, we only use this filter on the post with ID 6127. For all other contributions, this list is not filtered.
function atkp_modify_products_callback( $products ) {
if(get_the_ID() == 6127) {
$products_filtered = array();
foreach($products as $product) {
if(floatval($product->percentagesaved) > 40) {
$products_filtered[] = $product;
}
}
return $products_filtered ;
}
return $products ;
}
add_filter( 'atkp_modify_products', 'atkp_modify_products_callback', 10);
Just add this snippet to your functions.php or to a snippets plugin. But be sure to adjust the Post ID 6127.