Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Created March 27, 2012 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save strangerstudios/2216490 to your computer and use it in GitHub Desktop.
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.
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