I have a coupon that works when is used by a customer on the first order but on the next order the discount is set to $0. The coupon is set to have unlimited uses for all customers so I don't understand why it's being set to $0. A different customer that never used the coupon tested the coupon and it applied the correct amount. Any ideas why would it have this behavior?
Coupon applies $0
- A couple more things that I found out:- the issue is only on the cart page. Adding the coupon in the checkout works ok.- even though the coupon shows the message "Coupon code applied successfully" and the name of the coupon appears in the cart totals column with $0 it turns out that the coupon is not applied because I've tried listing all coupons using php and I'm getting an empty array. When I try a different coupon the array shows the coupon.
- Ok, don't think I was able to produce your error. I was able to produce a 0 discount, but it only happens if you have case sensitivity disabled in awocoupon config and the coupon you enter in the front end is not all the same case as the code entered in the backend. The fix for this was to delete a line of code, specifically in the file\wp-content\plugins\awocoupon\helper\estore\woocommerce\class-awocoupon-helper-estore-woocommerce-discount.php, line 267:
$code = $cart->applied_coupons[ $key ];
?>If that does not fix it, would need to debug it directly. For that, please send me a private message with temp access.
- It did not fix it but I have more info about the issue. The issue is not related to the use of the coupon. I have disabled a plugin called TaxJar - Sales Tax Automation for WooCommerce version 4.1.5 and the problem is gone.To replicate the issue using any customer I just set the address in the cart with the location : United States, Fort Worth, TX 76112, click Update and the discount goes to zero and the coupon seems to be removed from the applied coupons array as well. If I switch the address to United States, Indianapolis, IN 46202 then the coupon is added back in the applied coupons array and also the discount is no longer zero. TaxJar plugin has to be also active.