Title: Discount Rules Price function
Last modified: July 3, 2022

---

# Discount Rules Price function

 *  Resolved [sepehrzamani](https://wordpress.org/support/users/sepehrzamani/)
 * (@sepehrzamani)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/discount-rules-price-function/)
 * hello
    I have a question normally when we want to get the product price we use
   this: intval($product->get_price()); but this returns the woocommerce price, 
   not the dynamic price which this plugin generates. what should i use to get that
   price? thanks

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [sangeethasrinivasan](https://wordpress.org/support/users/sangeethasrinivasan/)
 * (@sangeethasrinivasan)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/discount-rules-price-function/#post-15794193)
 * Hi,
    Thank you for reaching out.
 * We would like to let you know that our plugin does not update the prices in the
   backend (Sale price for discounts).
    Our plugin applies discount on the fly dynamically
   while adding the product to cart. However, it doesn’t change the price in the
   back-end.
 * To get discount of a product, you can give a try using this snippet.
    [https://gist.github.com/AshlinRejo/c37a155a42c0e30beafbbad183f0c4e8](https://gist.github.com/AshlinRejo/c37a155a42c0e30beafbbad183f0c4e8)
 * Kindly check with your developer on how you can use this snippet in your site.﻿
   ​​
   Hope this helps!
 * Thanks
    Team Flycart
 *  Thread Starter [sepehrzamani](https://wordpress.org/support/users/sepehrzamani/)
 * (@sepehrzamani)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/discount-rules-price-function/#post-15794451)
 * my developer is out of reach now
    so can you just tell me what should I replace
   $product->get_price()); to receive the price that your plugin returns? thanks
 *  [sangeethasrinivasan](https://wordpress.org/support/users/sangeethasrinivasan/)
 * (@sangeethasrinivasan)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/discount-rules-price-function/#post-15795146)
 * Hi,
    Thanks for the reply.
 * The above snippet helps you to get a discount on a specific product.
    ﻿While 
   creating a feed you might have to add this event to get the discount value. ﻿
   If there is no discount it will return false.
 * Example:
    ﻿$sale_price = $product->get_sale_price();//sale price or final price ﻿
   $discount = apply_filters(‘advanced_woo_discount_rules_get_product_discount_price_from_custom_price’,
   10, $product, 1, $sale_price, ‘discounted_price’, true, true); ﻿if($discount !
   == false){ ﻿//$discount -> Here we get discount amount ﻿$sale_price = $discount; ﻿}
 * ﻿We recommend you to forward this to your developer.
    Hope this helps!
 * Thanks
    Team Flycart

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Discount Rules Price function’ is closed to new replies.

 * ![](https://ps.w.org/woo-discount-rules/assets/icon-256x256.png?rev=1977982)
 * [Discount Rules for WooCommerce](https://wordpress.org/plugins/woo-discount-rules/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-discount-rules/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-discount-rules/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-discount-rules/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-discount-rules/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-discount-rules/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [sangeethasrinivasan](https://wordpress.org/support/users/sangeethasrinivasan/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/discount-rules-price-function/#post-15795146)
 * Status: resolved