C
C
Cyril2018-01-27 01:37:11
WordPress
Cyril, 2018-01-27 01:37:11

WooCommerce. applying an after-tax coupon on the total order amount?

How can I get attached to the calculation of the full amount, namely the tax after applying a discount coupon on Woo.
Actually, after version 2.3, this feature was removed, since it is prohibited in the USA
https://wp-kama.ru/function/WC_Legacy_Cart::get_di...
https://woocommerce.wordpress.com/2014/12/12/ upcom...
Woo experts, what's the best way to recalculate?
as I understand it, you need to make a function similar to get_discounts_before_tax(); and call it in checkout and cart through filters?
P.S.S. As a result, it should be so that if we allow 1000 rubles for the entire order, there is a 10% tax, and the coupon comes with a discount of 200 rubles, the result was (1000 + 10%) -200 = 900 The coupon subtracts from the most recent total amount, and not the pre-total ( not (1000-200) + 10% = 880...)
P.S.S. There was only one similar question, and that one is remote, but not suitable.
How to make the coupon discount in woocommerce add up with the product discount?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question