Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save AnanthFlycart/7bcd3ce99e9674bc10ee40f37026d1f0 to your computer and use it in GitHub Desktop.

Select an option

Save AnanthFlycart/7bcd3ce99e9674bc10ee40f37026d1f0 to your computer and use it in GitHub Desktop.
// Reverse Strikeout Price (Swap - del and ins HTML tag)
add_filter('advanced_woo_discount_rules_strikeout_price_html', function ($html, $original_price, $discounted_price, $is_variable_product, $initial_price_html, $separator) {
if ($original_price != $discounted_price) {
if ($initial_price_html) {
$html = '<ins>' . $discounted_price . '</ins>' . $separator . '<del>' . $initial_price_html . '</del>';
} else {
$html = '<ins>' . $discounted_price . '</ins>' . $separator . '<del>' . $original_price . '</del>';
}
}
return $html;
}, 10, 6);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment