Oh, good idea. I'll try it right now.
Printable View
Oh, good idea. I'll try it right now.
No change unfortunately. :(
And just to humor me ...
If you compare your two configure.php files on the server in:
/includes/configure.php
/your_secret_admin/includes/configure.php
are you using the same database on both?
Yes, same data on both.
I cannot figure out why your Discount Coupons work this way ...
You are sure when you check your Restrictions that you are on the right Discount Coupon?
If you EDIT the Discount Coupon. what do you see in the URL for the cID= ...
If you look in phpMyAdmin, and search the table:
coupon_restrict
for the coupon_id that has the same value, what comes up?
Ok, I found where was the problem.
When I made this coupon it was te first one and was made as a test. So I deleted it, then tried to create it back, or should I say, to create another one with the same name, which off course didn't work. I saw the thread where you explained to rename, than copy and rename the copy. It worked like a charm and played a little with this to get familiar with he manipulation. It ended with 2 inactive coupons: AT00111R and... AT00111, which has the exact same name as the active coupon. It appears that ZenCart was having hard time to differentiate the active and the inactive one and was showing the description of the inactive one which has no restriction, but was running the restriction associated to the active coupon. So I renamed the inactive one to AT00111R2, et voilą! Weird huh...
But many many thanks for your help in this Ajeh! I really appreciated the time you gave me!! Best regards.
That is very weird ... thanks for hunting down the issue and for letting us know this is resolved ...
Now that I found how to fix this, is there a way to copy the restriction to over 100 coupons without having to edit them one by one? Could I do that directly in the DB?
Not easily ...
You could try to grab, via phpMyAdmin, the records for a valid Discount Coupon and then edit them with the next coupon_id and insert them ... but you are getting into some tricky edit/import and could make a real mess if you mess up ...
Something like:
And you would get something like:Code:SELECT restrict_id, coupon_id, product_id, category_id, coupon_restrict FROM coupon_restrict WHERE coupon_id = '7';
then, do a global replace of:Code:INSERT INTO coupon_restrict (coupon_id, product_id, category_id, coupon_restrict) VALUES
(7, 0, -1, 'Y'),
(7, 4, 0, 'N'),
(7, 6, 0, 'N'),
(7, 9, 0, 'N'),
(7, 10, 0, 'N'),
(7, 11, 0, 'N'),
(7, 12, 0, 'N'),
(7, 13, 0, 'N'),
(7, 17, 0, 'N'),
(7, 18, 0, 'N');
(7,
with the next Discount Coupon coupon_id that needs the same restrictions, for example, Discount Coupon coupon_id 12:
(12,
to get:
then import that ...Code:INSERT INTO coupon_restrict (coupon_id, product_id, category_id, coupon_restrict) VALUES
(12, 0, -1, 'Y'),
(12, 4, 0, 'N'),
(12, 6, 0, 'N'),
(12, 9, 0, 'N'),
(12, 10, 0, 'N'),
(12, 11, 0, 'N'),
(12, 12, 0, 'N'),
(12, 13, 0, 'N'),
(12, 17, 0, 'N'),
(12, 18, 0, 'N');
Before attempting it, be sure to backup your whole table:
coupon_restrict
If it possible to restrict coupon if certain product is in cart or other discount in cart.
Product restriction only work for that particular product but how can we restrict coupon to whole cart content if certain product is in cart or any other discount in cart.