Getting the discounted price for another plugin/integration
-
Hi guys,
I’m the author of a plugin that generates feeds for a Portuguese price comparison website, and a client of ours is using your plugin to apply site-wide discounts.
When generating the feed, we use the$product->get_price()
and$product->get_current_price()
methods, and we’re not getting the discounted price shown on the product page.We only need to get the discount price for very simple discounts that are not based on cart rules, like site-wide and category-wide discounts, for example.
Looking into your code we found out we could get the discount price like this:
$prices = \Wdr\App\Controllers\ManageDiscount::calculateInitialAndDiscountedPrice( $product, 1 ); return $prices['discounted_price_with_tax'];
Is this the recommended way for a third-party integration to get the discounted price calculated by your plugin, or do you recommend an alternative, future-proof, method?
- The topic ‘Getting the discounted price for another plugin/integration’ is closed to new replies.