• The new versions of WooCommerce now allow adding coupons to existing orders by using the “Apply Coupon” button on the order edit page.

    If you create a coupon with a role restriction, it will incorrectly take the role of the admin instead of getting the role of the customer for that particular order.

    So a coupon with a specific role restriction can never be added to an order because it will say “Sorry, it seems this coupon is not for you”.

    FIX:
    WCECF_Controller.php line#441 and line#453:
    Instead of using wp_get_current_user(), it should instead get the order customer ID and check role if the object is a WC_Order.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Soft79

    (@josk79)

    Good point. I might even ignore that rule in case of WC_Order… I’ll think about it.

    Thanks for pointing out.

    Plugin Author Soft79

    (@josk79)

    I just released 2.6.2 but forgot to include a solution for this issue.

    I will include it in a future release.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding coupon to order not working’ is closed to new replies.