Post by samdz » Mon Nov 12, 2012 3:35 am

Hi guys,

When customer order a Gift Voucher; I get a Voucher with 10 charcters; but I need up the numbers of charcters in the voucher code to 15 Charcters;

Any help Please ?


Thank's

Sam

Active Member

Posts

Joined
Fri Jan 28, 2011 3:02 am

Post by Avvici » Tue Nov 13, 2012 12:58 am

Open /admin/controller/sale/voucher.php and find this code:

Code: Select all

if ((utf8_strlen($this->request->post['code']) < 3) || (utf8_strlen($this->request->post['code']) > 10)) {
              $this->error['code'] = $this->language->get('error_code');
        } 
Change the 10 to 15. This will allow a validation of 15 digits.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by samdz » Tue Nov 13, 2012 1:47 am

thank you sir for interst.

BUT it didn't work when customers order a gif voucher,

I think this is only to get error when add a gif manully from admin panel.

Also when change the number 10 to 15 the vouche created but ONLY with 10 numbers .

Any other solution ?

Thank's

Sam

Active Member

Posts

Joined
Fri Jan 28, 2011 3:02 am

Post by Avvici » Tue Nov 13, 2012 3:14 am

Ah, the front end. Just open: catalog/controller/checkout/checkout.php and find this line of code:

Code: Select all

'code'             => substr(md5(mt_rand()), 0, 10), 
Change the 10 to 15.

Cheers O0

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by samdz » Tue Nov 13, 2012 4:57 am

Hi, sorry but I didn't find this in this file,
but I find in these files :
- catlog/controller/checkout/confirm.php (one code)
- catalog/controller/checkout/manual.php (three code)

I have changed all from 10 to 15, BUT always didn't work. ???

regards.

Sam

Active Member

Posts

Joined
Fri Jan 28, 2011 3:02 am

Post by Avvici » Tue Nov 13, 2012 7:03 am

samdz wrote:Hi, sorry but I didn't find this in this file,
but I find in these files :
- catlog/controller/checkout/confirm.php (one code)
- catalog/controller/checkout/manual.php (three code)

I have changed all from 10 to 15, BUT always didn't work. ???

regards.

Sam
I gave you good instructions. What version of OC are you using?

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by samdz » Tue Nov 13, 2012 3:27 pm

I am using the version 1.5.4.1

Active Member

Posts

Joined
Fri Jan 28, 2011 3:02 am

Post by mylasbags » Thu Nov 15, 2018 12:57 am

I'm using v.3.0.1.1. Can someone show to increase the code length in v.3.0.1.1?

New member

Posts

Joined
Wed May 18, 2011 10:24 pm
Location - SC, USA
Who is online

Users browsing this forum: Baidu [Spider] and 74 guests