I am using Magento2 enterprice edition 2.1.2

Magneto2 specific coupons are working well.

When created a cart price rule with coupon as a "auto" and generated multiple coupons in Manage Coupon code. When used this coupon code magento showing all coupons are invalid.

Please check attached screen-shot's

[enter image description here][1]enter image description here

enter image description here

  • facing same problem.
    – Sejal Shah
    May 18, 2017 at 11:34
  • are you fixed it?
    – Init
    Jun 29, 2017 at 4:26
  • i found it: youtu.be/4B_9sWsJcYM , you can follow step of video
    – Init
    Jun 29, 2017 at 15:57
  • 1
    In my case the issue is To Date. It was set too far ahead i.e. 09/30/2117. When I cross checked, it was working upto 2035.
    – Deeps
    Sep 21, 2017 at 14:26

2 Answers 2


Since code generator is also become part of consumer queue after 2.3.x , you can manually run this command to start generating the coupon codes,

php bin/magento queue:consumers:start codegeneratorProcessor



Because this is a bug on Magento 2.1. There is a difference about the type of coupon which auto-generate To fix it. Go to file vendor/magento/module-sales-rule/Model/ResourceModel/Rule/Collection.php

$orWhereConditions = [
        '(main_table.coupon_type = ? AND rule_coupons.type = 0)',

Then change rule_coupons.type = 0 to rule_coupons.type = 1 Hope that this will help everyone

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.