Created
January 28, 2019 11:25
-
-
Save AshlinRejo/1fe3ea1e86e556f35840beb329a0f023 to your computer and use it in GitHub Desktop.
Woo discount rules: Add content before strikeout only for variable product
This file contains hidden or 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
| if(!function_exists('woo_discount_rules_price_strikeout_after_discount_price_method')){ | |
| function woo_discount_rules_price_strikeout_after_discount_price_method($item_price, $product){ | |
| if($product->is_type( 'variable' )) { | |
| $item_price = 'From: '.$item_price; | |
| $item_price = str_replace('</del> <ins>', '</del> From:<ins>', $item_price); | |
| } | |
| return $item_price; | |
| } | |
| } | |
| add_filter('woo_discount_rules_price_strikeout_after_discount_price', 'woo_discount_rules_price_strikeout_after_discount_price_method', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment