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?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
You need to modify 2 tables
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;
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.
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.