How to get final subtotal after coupon applied?
-
Hi,
I need to find a solution for this scenario.
I’m looking for a way to apply a % rebate on the Final subtotal after all coupon applied and before shipping and taxes
The case:
The store give a % rebate based on subtotal.
If the cart has some item that will be free by a coupon or get some other rebate by a coupon, the item price will be counted in the subtotal.For example the cart has
1 item at 45$
1 item at 10$ (this item will be free or will get a special price by a coupon code applied after the subtotal).The store offer 10% rebate if the subtotal is over 50$
So the subtotal is 55$
the coupon applied let say -10$ so the final subtotal is 45$I would like to apply the 10% on Final subtotal if it is +50$
(after coupons is applied and before shipping & taxes)So how can I get the final subtotal based on my example?
Can I use this function if not which is the function to use so I can create a snippet to fix the problem?//Gets cart total. This is the total of items in the cart, but after discounts.
`public function get_cart_contents_total() {
return apply_filters( ‘woocommerce_cart_’ . __FUNCTION__, $this->get_totals_var( ‘cart_contents_total’ ) );
}I’m open to suggestion
Thanks
- The topic ‘How to get final subtotal after coupon applied?’ is closed to new replies.