Skip to content

Instantly share code, notes, and snippets.

@AshlinRejo
Last active November 18, 2019 07:40
Show Gist options
  • Save AshlinRejo/b57ce8d44d51c8d391f5f740430f3f71 to your computer and use it in GitHub Desktop.
Save AshlinRejo/b57ce8d44d51c8d391f5f740430f3f71 to your computer and use it in GitHub Desktop.
Woo Discount Rules: Get discount for a product
/**
* To get discount amount for the specific products
* If there is no discount it return null value.
*/
global $flycart_woo_discount_rules;
if(!empty($flycart_woo_discount_rules)){
$discounted_price = $flycart_woo_discount_rules->pricingRules->getDiscountPriceOfProduct($product);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment