Last active
April 13, 2021 03:07
-
-
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
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
/* | |
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('$47.00', '<span style="text-decoration: line-through">$97</span> $47', $text); | |
return $text; | |
} | |
add_filter('pmpro_level_cost_text', 'pmpro_level_cost_discount', 10, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/