Support » Plugin: Discount Rules for WooCommerce » Implementing “buy 2 get 1 free” user feedback

  • Resolved romantss


    Hey guys,

    Creating a price rule based on a coupon to implement a “buy 2 get 1 free”
    workes like a charm in terms of calculating the discount and such. Thank you guys for that.

    What I’d like to achieve now is to give the customer some feedback if they applied such a coupon while there are less than three items in the cart.

    I thought about grabbing all the coupons that have been applied via WC()->cart->coupons_applied. Then I’d check if any of those are linked to a price rule that implements the “buy 2 get 1 free”. If that were the case, I’d like to print out a message that there are not enough items in the cart for the coupon to actually do anything.

    Is anything like this possible already or would you be so kind as to tell me if there was a way to grab the price rules and match them to the applied coupons?

    Kind regards,


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