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

Case Insensitive Coupon Codes

 
Reply
   X-Cart forums > X-Cart 5 > General questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 05-24-2019, 11:51 AM
 
CCP CCP is offline
 

Member
  
Join Date: Jul 2012
Posts: 16
 

Default Case Insensitive Coupon Codes

Is it possible to change Coupon codes to be case-insensitive?

We have a fair number of clients who complain that they can't enter the codes, when it turns out they aren't typing them in ALLCAPS.
__________________
Version 4.2.3
X-Cart Gold

Add-on: X-FeatureComparison
Add-on: X-Magnifier
Add-on: X-AOM (Advanced Order Management)
Reply With Quote
  #2  
Old 06-03-2019, 08:20 AM
  pino_xcart's Avatar 
pino_xcart pino_xcart is offline
 

X-Cart team
  
Join Date: Nov 2015
Posts: 8
 

Default Re: Case Insensitive Coupon Codes

Hi,

The following patch should do the trick:

HTML Code:
Index: src/classes/XLite/Module/CDev/Coupons/Model/Repo/Coupon.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- src/classes/XLite/Module/CDev/Coupons/Model/Repo/Coupon.php (revision 0ccac487726f63245ce987723148dcef1575ca44) +++ src/classes/XLite/Module/CDev/Coupons/Model/Repo/Coupon.php (date 1559578157000) @@ -91,7 +91,7 @@ protected function defineFindOneByCode($code) { $queryBuilder = $this->createQueryBuilder('c') - ->andWhere('COLLATE(c.code, utf8_bin) = :code') + ->andWhere('LOWER(COLLATE(c.code, utf8_bin)) = LOWER(:code)') ->setParameter('code', $code); return $queryBuilder;
Quote:
Originally Posted by CCP
Is it possible to change Coupon codes to be case-insensitive?

We have a fair number of clients who complain that they can't enter the codes, when it turns out they aren't typing them in ALLCAPS.
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > General questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 03:50 AM.

   

 
X-Cart forums © 2001-2020