View Single Post
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


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;
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