Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Limit one coupon per customer

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #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
  #2  
Old 11-03-2014, 04:16 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Limit one coupon per customer

Hi Per!

Thank you for suggestion! Please report it in ideas.x-cart.com.
Meanwhile, I can help you with a simple mod that will allow customer to input only one coupon code.

If you are ready to go, please create a module according to the article here:
http://kb.x-cart.com/display/XDD/Step+1+-+creating+simplest+module
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #3  
Old 11-03-2014, 04:29 AM
 
drholmes drholmes is offline
 

Advanced Member
  
Join Date: Oct 2014
Posts: 84
 

Default Re: Limit one coupon per customer

Hi Tony,

I've would love to know how to turn that into a module, since I'm trying to wrap my head around making modules. I did follow that tutorial once, but it crashed the store, and I had to follow the instructions for force redeployment. The new system is complex, I hope you know that

I do strongly believe that this should be in the coupon module itself, since businesses have known for hundreds of years that giving people unlimited coupons leads to every order being for a total of zero dollars.

I did try to post there, but the website kept redirecting me to an X-Cart 4 suggestion form where I had to "re-ask" the question every time I clicked submit, so I gave up.

Best,

Per
__________________
X-Cart Business 5.4.1.7, No third party modules, most modules disabled, zero modifications other than CSS.
Reply With Quote
  #4  
Old 11-03-2014, 04:40 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Limit one coupon per customer

I am not arguing, this is a great improvement to Coupons functionality, that is why I am asking to report to ideas tracker.

Please try to go to the direct link here: http://ideas.x-cart.com/forums/229428-x-cart-5-x

Let me know if it still does not allow you to post an idea.

As for module creation, if your store crashes again, please create a new thread with the error messages from php_errors.log file of the <X-Cart>/var/log/ folder.

Tony.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:15 AM.

   

 
X-Cart forums © 2001-2020