Created
March 11, 2024 07:38
-
-
Save sarancartrabbit/b479523a0033b6792fc51c14b1c56cea to your computer and use it in GitHub Desktop.
Woo Discount Rules: Show Discount bar only on stock product for product page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('advanced_woo_discount_rules_advance_table_based_on_rule', function ($advanced_layout, $rule, $discount_calculator, $product, $product_price, $html_content){ | |
if(!$product->is_in_stock()){ | |
$advanced_layout = []; | |
} | |
return $advanced_layout; | |
},10,6); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment