2

In the database there is a table called salesrule_coupon which has all the coupon codes in it.

I need to change the column expiration_date for all the coupons to the same date 30-08-2024,

Is This possible?

1

You need to modify 2 tables salesrule and salesrule_coupon.

You can use following sql query:

UPDATE `salesrule_coupon` SET `expiration_date` = '2024-08-30';
UPDATE `salesrule` SET `to_date` = '2024-08-30' where `coupon_type` = 2;
  • Works great, thanks! – n00bly Aug 28 at 10:33
2

Yes it is possible,the below query will update all your coupon codes expiry date since we did not use WHERE clause in the query:

UPDATE salesrule_coupon SET expiration_date = '2024-08-30'

After running the above query in the database, run the cache clean and flush commands as below:

php bin/magento cache:clean && php bin/magento cache:flush

Please note that we did not use a WHERE clause in the above solution so it will update all the records in the database as per your question.

0

It's possible, you have to change your cart rules settings. You should have fields called "from" and "to". Just set the date that you want in these fields. It will update all the coupon code generated. Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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