To Restrict ALL Products that are using Discount Quantities from a Discount Coupon, you could to the EXPORT/IMPORT game with phpMyAdmin ...
You need to read through this a few times and test the results ...
First ... Backup database before doing this, as you can really make a mess when you least expect it ...
Make Discount Coupon and get coupon_id, EXAMPLE: coupon_id 7
In phpMyAdmin, get all products_id that have products_discount_quantity:
Code:
SELECT distinct products_id, 7 AS coupon_id, 0 AS category_id, 'Y' AS coupon_restrict FROM products_discount_quantity
Export DATA ONLY to a SQL
Check new SQL that you exported for all fieldnames and data ...
Example to restrict all products with discount quantities initially should look like something like this:
Code:
INSERT INTO products_discount_quantity (products_id, coupon_id, category_id, coupon_restrict) VALUES
(8, 7, 0, 'Y'),
(127, 7, 0, 'Y'),
(130, 7, 0, 'Y'),
(175, 7, 0, 'Y'),
(176, 7, 0, 'Y'),
(177, 7, 0, 'Y'),
(178, 7, 0, 'Y'),
(205, 7, 0, 'Y');
Edit exported SQL and change table name from:
products_discount_quantity
to read:
coupon_restrict
Change field name:
products_id
to be:
product_id
SQL should now look something like this:
Code:
INSERT INTO coupon_restrict (products_id, coupon_id, category_id, coupon_restrict) VALUES
(8, 7, 0, 'Y'),
(127, 7, 0, 'Y'),
(130, 7, 0, 'Y'),
(175, 7, 0, 'Y'),
(176, 7, 0, 'Y'),
(177, 7, 0, 'Y'),
(178, 7, 0, 'Y'),
(205, 7, 0, 'Y');
IMPORT from SQL and check the Coupon Restrictions on this Discount Coupon to ensure all are correct ...
Fun, eh?
Bookmarks