I need to fetch discount applied to every line item when user applied a coupon on woocommerce checkout page, I can fetch a total discount from order post meta but i need discount applied to specific line item , i am also using a filter woocommerce_coupon_get_discount_amount which alters discount for every line item but i am unable to find discount given to each line item when i load
order->get_items() array. So for dynamic discount which changed during applied filter how can i get discounts for each line item at thankyou page.
woocommerce_coupon_get_discount_amount filter is called before order is placed so i cannot store a custom meta to order type post and after payment done cart is also empty. So how can i keep track of things.
Read more here: Get line item discount applied on woocommerce thankyou page