Hi,
Yes, you can use the fsl_min_amount
filter hook to control the display. You need to check the products in the cart and return null
if none of the products match your criteria.
Below is a simplified version of how to achieve this:
add_filter('fsl_min_amount', function ($amount) {
if (!WC()->cart) {
return;
}
// Define allowed attributes or other criteria for products.
// Loop through each item in the cart.
foreach (WC()->cart->get_cart() as $cart_item) {
// Check if the product matches the allowed criteria.
// If a product matches, set a flag or take necessary action.
}
// If no products match, set the amount to null.
return $amount;
});
If null
is returned by this filter, it will prevent the progress bar from being displayed on the cart and checkout pages.