I need to specify a specific company id length. It needs to follow this pattern "111111ABC" during account registration and checkout. Can anyone provide some insight or help? I am completely lost here.
Last edited by zaidladha on Thu Dec 24, 2015 6:23 am, edited 2 times in total.
ok,
I think I figured out that I just need this code, but not sure where to put it!!!
my test website is www.canadafishingtackle.com
(utf8_strlen($this->request->post['company_id']) <
|| (utf8_strlen($this->request->post['company_id']) > 10))
I think I figured out that I just need this code, but not sure where to put it!!!
my test website is www.canadafishingtackle.com
(utf8_strlen($this->request->post['company_id']) <

Account registration and checkout files:
- catalog/controller/account/register.php
- catalog/controller/checkout/guest.php, register.php and payment_address.php
'company_id' is only validated when set in customer group !
Search for:
You can use preg_match instead of checking on empty:
6 digits and 3 characters
- catalog/controller/account/register.php
- catalog/controller/checkout/guest.php, register.php and payment_address.php
'company_id' is only validated when set in customer group !
Search for:
Code: Select all
if ($customer_group['company_id_display'] && $customer_group['company_id_required'] && empty($this->request->post['company_id'])) {
$json['error']['company_id'] = $this->language->get('error_company_id');
}
Code: Select all
!preg_match ('/^([0-9]{6})([A-Z]{3})$/', $this->request->post['company_id'])
Add lowercase a-z to pattern:
Code: Select all
!preg_match ('/^([0-9]{6})([A-Za-z]{3})$/', $this->request->post['company_id'])
Who is online
Users browsing this forum: No registered users and 4 guests