Add fees to order from the admin save hook
-
I currently have this code below to add the discount tax back onto the cart as a fee. My client for this site wants coupons applied after tax because of vendor restrictions on sales.
function lws_apply_coupon_price($cart) { $discount_tax = $cart->get_discount_tax(); if(count($cart->get_applied_coupons()) > 0) { $cart->add_fee('Discount Tax', (float)$discount_tax, false); } } add_action('woocommerce_cart_calculate_fees', 'lws_apply_coupon_price');
However, this does not work when the coupon was applied from the admin panel. What is the hook to add fees to an order after saving from the admin page?
And how do I get the user’s cart object from only the order ID? Not MY cart object but the cart object of the user that placed the order.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Add fees to order from the admin save hook’ is closed to new replies.