View Single Post
  #1  
Old 11-01-2014, 12:59 AM
 
drholmes drholmes is offline
 

Advanced Member
  
Join Date: Oct 2014
Posts: 84
 

Default Limit one coupon per customer

Hi,

There is a fundamental problem with the coupon module in X-Cart 5, that it allows customers to use an unlimited amount of coupons. A feature is missing to allow customers to use only one coupon. I've hacked this, but it should be a feature.

Marketing with coupons is about giving codes to websites and blogs for e.g. 10% off. All of these codes end up on www.retailmenot.com, and since X-Cart allows users to enter an unlimited amount of coupons, people can give themselves 10% + 15% + 10% + 20% + 10% + 10% + 15% etc. discounts, until we would literally have to pay them money in order to sell them something.

The few limits are about shopping cart total or times-used, none of which are helpful in controlling that people don't abuse the discounts.

Ideally, this should be a per-coupon option:

(X) Allow coupon to be used with other coupons

-- which can default to being on. When it's off, the cart should be flushed of all existing coupons before a new one is added. That makes it one-per-customer.

This is the default behavior we need -- there is never a situation where allowing multiple coupons is a good thing for us, it's always bad.

So in /XLite/Module/CDev/Coupons/Controller/Customer/Coupon.php at line 122, I've inserted:

Code:
// Delete All Existing foreach ($this->getCart()->getUsedCoupons() as $usedCoupon) { $this->getCart()->getUsedCoupons()->removeElement($usedCoupon); \XLite\Core\Database::getEM()->remove($usedCoupon); }

This flushes the cart of existing coupons.

I think this is not some mere preference for us, there is a fundamental business problem with allowing unlimited coupon usage. Therefore, I think this should be an option in the coupon itself in future updates of the Coupon module.

Best,

Per
__________________
X-Cart Business 5.4.1.7, No third party modules, most modules disabled, zero modifications other than CSS.
Reply With Quote