Post by rwenve » Wed Feb 08, 2012 5:49 am

Hi - I am using OC 1.5.1.3 and I am trying to find out where the coupon code is being restricted to only 10 characters. I am looking in the admin/view/template/sale/coupon_form but I am only seeing the SQL statements that are inserting the code. I see some $error_name variables but I dont know where to find those if that is where I need to change it. I did look in the error folder but that only includes the not found and the permission tpl. It seems like this is a simple fix but Im going blind trying to find it. It doesn't appear to be restricted by the SQL. Any help would be great.

Thanks

Newbie

Posts

Joined
Wed Feb 08, 2012 5:40 am

Post by kedgetech » Wed Feb 08, 2012 7:31 am

Its restricted by controller validation admin\controller\sale\voucher.php . If you have a custom theme for admin (which is not normal ) you might want to check there for similar file.

if ((utf8_strlen($this->request->post['code']) < 3) || (utf8_strlen($this->request->post['code']) > 10 ))

update 10 to size you want but below the database column allowance.

User avatar
Active Member

Posts

Joined
Mon Mar 22, 2010 5:20 pm
Location - USA, Australia, India

Post by rwenve » Wed Feb 08, 2012 7:31 pm

Thanks - I did change that over thanks to your reply, however it ended up being on the validation in the coupon file vs voucher, nor would I have actually pulled up the database to increase the limit there. But I took care of both so thank you

Newbie

Posts

Joined
Wed Feb 08, 2012 5:40 am

Post by cartgirl » Sun Nov 04, 2012 5:16 am

I run version 1.5.3.1

Do I need to edit the database in order to increase the coupon character limit from 10 to 12 characters??

Active Member

Posts

Joined
Fri Aug 03, 2012 10:12 pm

Post by rph » Sun Nov 04, 2012 5:45 am

Yes, both the database and controller (as described above) need to be updated.

Code: Select all

ALTER TABLE `coupon` CHANGE `code` `code` VARCHAR(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL;

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska
Who is online

Users browsing this forum: No registered users and 6 guests