Created
March 27, 2012 14:38
-
-
Save strangerstudios/2216490 to your computer and use it in GitHub Desktop.
Using the jigoshop_sale_price filter to give Paid Memberships Pro members a site-wide discount.
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
function my_jigoshop_sale_price($price, $product) | |
{ | |
if(pmpro_hasMembershipLevel()) | |
{ | |
//no sale price yet? | |
if(empty($price)) | |
$price = $product->get_price(); | |
$price = intval(($price * 0.90)*100)/100; | |
} | |
return $price; | |
} | |
add_filter("jigoshop_sale_price", "my_jigoshop_sale_price", 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment