Get discount information after order
-
Hello,
I want to get the discounted price and the non-discounted price after ordering. However, I couldn’t find a solution.For example, for product A;
Regular Price: 100 (Tax Included)
Sales Price: 80 (Tax Included)After Order:
$order = wc_get_order( $order_id ); foreach ($order->get_items() as $item_id => $item) { $regular_price = $order->get_item_subtotal( $item, false, true ); $sale_price = $order->get_item_total( $item, false, true ); }
However, in such a case, both variables are equal. So $regular_price and $sale_price variables. There is a discount here, why are these variables equal?
I’ve looked through many resources but couldn’t find what I was looking for. Could you help ?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Get discount information after order’ is closed to new replies.