Zach Spencer
Zach Spencer

Reputation: 1889

Magento require coupon to purchase product

After searching on Google for quite a while I am going crazy. My question: Can you configure Magento to require a coupon code to buy specific product?

This is for a promotion my employer is running, basically we want to allow specific customers to buy specific product in our Magento store before any of our other customers. Thank you for your suggestions.

Upvotes: 0

Views: 211

Answers (1)

Deependra Singh
Deependra Singh

Reputation: 1514

A brief idea I can give here.

  1. Create a backend module, which has own db tables to save linking of products ID to specific coupon, multiple coupon or just a check that coupon is required, depending on your case. From this Module you should be able to define such linking of product to coupon.
  2. Since customer apply a coupon code at cart page, so we will let customer add product into cart. Then edit isDisabled method of Mage_Checkout_Block_Onepage_Link class. where you will check if your quote has any product from the product-coupon linking defined in your module and coupon is not applied yet. Similar thing you can should do for Multishipping method if it is enabled in your Magento. So whenever coupon coupon code will be applied page will refresh and button will get enabled.
  3. Same check you will need to put in indexAction of Mage_Checkout_OnepageController.

Upvotes: 1

Related Questions