Getting the discounted price for 3rd party integration
-
I’m trying to integrate your discount price, only for discounts that are not affected by cart rules, like site-wide or category-wide discounts, but when using
$product->get_current_price()
I get the base product price and not the one generated by your discount.After checking your code I’m now using this:
if ( $prices = \Wdr\App\Controllers\ManageDiscount::calculateInitialAndDiscountedPrice( $product, 1 ) ) { if ( isset( $prices['discounted_price_with_tax'] ) && floatval( $prices['discounted_price_with_tax'] ) > 0 ) { $price = floatval( $prices['discounted_price_with_tax'] ); } } return $price;
Is it OK to use this method, or do you recommend another safer and future-proof approach?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Getting the discounted price for 3rd party integration’ is closed to new replies.