events document
Document events related to the project.
<?php
/**
* Get discount of a product
* @param $product integer|object (Product object Example: wc_get_product($product_id))
* @param $quantity int
* @return boolean|float|int - is product has no discounts it returns false
*/
$discount = apply_filters('advanced_woo_discount_rules_get_discount_price', $product, $quantity);
if($discount !== false){
echo $discount // HERE YOU GET DISCOUNT PRICE
}
----------------------------------------------------------------------------------------------------------
/**
* Get discount of a product from custom price
* @param $product integer|object (Product object Example: wc_get_product($product_id))
* @param $quantity int
* @param $custom_price int|float
* @return boolean|float|int - is product has no discounts it returns false
*/
$discount = apply_filters('advanced_woo_discount_rules_get_discount_price', $product, $quantity, $custom_price);
if($discount !== false){
echo $discount // HERE YOU GET DISCOUNT PRICE
}
----------------------------------------------------------------------------------------------------------
Get discount percentage of a product reffer the following snippet
https://gist.github.com/AnanthFlycart/6becf99a52ee41f4fa65c362df7d301b
----------------------------------------------------------------------------------------------------------