The coupons tab is where you will create and delete coupons as well as edit existing ones. Coupons, by default, are created one at a time in MemberMouse. However, there may be a situation where you need to create a large number of coupons. If you are familiar with PHP, that can be done in MemberMouse.
Create A Large Number Of Coupons
To create a large number of coupons, you will need to use the following mySQL statement. Here's the insert SQL for inserting a single coupon:
INSERT INTO mm_coupons (`coupon_name`, `coupon_code`, `coupon_type`, `coupon_value`, `description`, `quantity`, `start_date`, `end_date`, `recurring_billing_setting`, `date_modified`, `date_added`) VALUES ('Sample Coupon', 'sample', 'percentage', '20', NULL, '-1', NOW(), '', 'all', NOW(), CURRENT_TIMESTAMP);
The three possible values for
While a 25% off coupons would have values like this:
Once you have your single coupon statement, you will need to write a simple PHP script, iterate over each coupon from a CSV file and run the insert query.
Adding Product Restrictions to Coupons
INSERT INTO `mm_coupon_restrictions` (`coupon_id`, `product_id`, `date_added`) VALUES ('<coupon_id>', '<product_id>', CURRENT_TIMESTAMP);
<coupon_id>with the ID of the desired coupon and
<product_id>with the ID of the desired product.