Wrong coupon is used
-
Hello, I have build the basics of a webshop with woocommerce and some extra plugins. I already had everything working but now i have an issue with the coupon feature.
I have different coupons, all automatically added to the cart. In some cases it can happen that there are 2 coupons valid, then only 1 can be used. So far so good. But every time the wrong coupon is automatically used.
I want that the system automatically adds the coupon with the highest discount, now it adds the wrong one.In the system log i can see that the system knows both coupons are valid:
2020-10-15T21:01:08+00:00 DEBUG init WJECF_Debug::log_the_request ======== GET: frontend /winkelmand/ ======== 2020-10-15T21:01:08+00:00 DEBUG woocommerce_check_cart_items WJECF_Autocoupon::get_all_auto_coupons Autocoupons: 1soep+1rw, 3soep 2020-10-15T21:01:08+00:00 DEBUG woocommerce_check_cart_items WJECF_Autocoupon::coupon_can_be_applied Email restrictions: [ ] User emails: [ myemail ] Match: yes 2020-10-15T21:01:08+00:00 DEBUG woocommerce_check_cart_items WJECF_Autocoupon::coupon_can_be_applied Email restrictions: [ ] User emails: [ myemail ] Match: yes 2020-10-15T21:01:08+00:00 DEBUG woocommerce_after_calculate_totals WJECF_Autocoupon::coupon_can_be_applied Email restrictions: [ ] User emails: [ myemail ] Match: yes 2020-10-15T21:01:08+00:00 DEBUG woocommerce_after_calculate_totals WJECF_Autocoupon::coupon_can_be_applied Email restrictions: [ ] User emails: [ myemail ] Match: yes 2020-10-15T21:01:08+00:00 DEBUG woocommerce_after_calculate_totals WJECF_Autocoupon::update_matched_autocoupons Auto coupons that should be in cart: 1soep+1rw 2020-10-15T21:01:08+00:00 DEBUG woocommerce_after_calculate_totals WJECF_Autocoupon::update_matched_autocoupons Coupons in cart: 1soep+1rwI use the “WooCommerce Extended Coupon Features FREE” plugin for some extra functionality.
Does someone have an idea how i can change the ‘priority’ of adding coupons to the cart or how i can learn the system to always use the coupon with the highest discount?
The topic ‘Wrong coupon is used’ is closed to new replies.