Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save AshlinRejo/1fe3ea1e86e556f35840beb329a0f023 to your computer and use it in GitHub Desktop.

Select an option

Save AshlinRejo/1fe3ea1e86e556f35840beb329a0f023 to your computer and use it in GitHub Desktop.
Woo discount rules: Add content before strikeout only for variable product
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