Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Last active April 13, 2021 03:07
Show Gist options
  • Save strangerstudios/d1503990478042341c14f35b7205f8e5 to your computer and use it in GitHub Desktop.
Save strangerstudios/d1503990478042341c14f35b7205f8e5 to your computer and use it in GitHub Desktop.
Show non-discounted price with strike through in Paid Memberships Pro. tag:pmpro_level_cost_text
/*
Show non-discounted price with strike through.
Edit the membership level to use the discounted price.
This specifically changes occurrences of $47 to ~$97~ $47. You will need to adjust for your specific prices and price formatting.
*/
function pmpro_level_cost_discount($text, $level, $tags, $short)
{
$text = str_replace('&#36;47.00', '<span style="text-decoration: line-through">&#36;97</span> &#36;47', $text);
return $text;
}
add_filter('pmpro_level_cost_text', 'pmpro_level_cost_discount', 10, 4);
@laurenhagan0306
Copy link

This recipe is included in the blog post on "Run a “Sale” on Your Membership Site and Show the Regular Price with Strikethrough Style" at Paid Memberships Pro here: https://www.paidmembershipspro.com/run-sale-membership-site-show-regular-price-strikethrough-style/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment