Support » Plugin: Discount Rules for WooCommerce » Coupon not being calculated

  • Hi,

    I’m using Discount Rules to apply discounts on Cart totals.

    The cart is managed via REST API (am using a custom implementation of

    Currently when the cart is updated (product added, quantity changed, product removed), the coupon is not applied until the next time a request for the cart occurs.


    1. Change quantity in cart (discount not applied)
    2. Change quantity again in cart (discount is applied from previous change)
    3. Remove an item (discount is applied from previous change)

    If you make a change and GET the cart again, the discount rule is reflected.

    After any cart changes, the API run the same function that is used to GET a cart.

    So my question is, what methods can I call to force your plugin to calculate the coupons before using WC()->cart->get_cart()?

    I have tried

    – FlycartWooDiscountRules->applyRulesBeforeMiniCart();
    – FlycartWooDiscountRules->applyCartDiscountRules();
    – WC()->cart->calculate_totals();


Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.