I have successfully created a Custom Field in Customers. This shows in registration page but when filled out as a customer it does not save. Also the field is not available in admin area at all - does not show when looking at Customer in question.
Anyone come across this?
Big Decision
Website Production, Ecommerce & Digital Marketing in the UK
http://www.bigdecision.co.uk
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Would I need to create custom fields again or should this adjust and work for existing custom fields I already created?
Big Decision
Website Production, Ecommerce & Digital Marketing in the UK
http://www.bigdecision.co.uk
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Big Decision
Website Production, Ecommerce & Digital Marketing in the UK
http://www.bigdecision.co.uk
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I was trying to login as an existing customer then edit this field under 'edit account' to add a value for this new field
Big Decision
Website Production, Ecommerce & Digital Marketing in the UK
http://www.bigdecision.co.uk
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
The field shows fine in the customer account area - it is just the fact that the entered value does not save
Big Decision
Website Production, Ecommerce & Digital Marketing in the UK
http://www.bigdecision.co.uk
find:
Code: Select all
$this->db->query("UPDATE " . DB_PREFIX . "customer SET firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', custom_field = '" . $this->db->escape(isset($data['custom_field']['account']) ? json_encode($data['custom_field']['account']) : '') . "' WHERE customer_id = '" . (int)$customer_id . "'");
Code: Select all
if (!empty($this->session->data['user_token'])) {
exit;
}
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I do indeed get the blank screen. There is no message that shows however and nothing gets saved.
Can I just check something please - code below (have included a little above and below so you can see!). I just wanted to ensure I didn't have an extra bracket in there:
return $customer_id;
}
public function editCustomer($customer_id, $data) {
$this->db->query("UPDATE " . DB_PREFIX . "customer SET firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', custom_field = '" . $this->db->escape(isset($data['custom_field']['account']) ? json_encode($data['custom_field']['account']) : '') . "' WHERE customer_id = '" . (int)$customer_id . "'");
if (!empty($this->session->data['user_token'])) {
exit;
}
}
public function editPassword($email, $password) {
$this->db->query("UPDATE " . DB_PREFIX . "customer SET salt = '" . $this->db->escape($salt = token(9)) . "', password = '" . $this->db->escape(sha1($salt . sha1($salt . sha1($password)))) . "', code = '' WHERE LOWER(email) = '" . $this->db->escape(utf8_strtolower($email)) . "'");
}
Big Decision
Website Production, Ecommerce & Digital Marketing in the UK
http://www.bigdecision.co.uk
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
The regex doesn't have anything to do with it does it? Nothing is specified here but wondered if it should maybe?
Big Decision
Website Production, Ecommerce & Digital Marketing in the UK
http://www.bigdecision.co.uk
find:
Code: Select all
$this->session->data['success'] = $this->language->get('text_success');
Code: Select all
if (!empty($this->session->data['user_token'])) {
exit;
}
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Unfortunately still no luck.
I tried creating a new customer as well with this field filled in but it just does not register.
I checked in phpmyadmin too and nothing showing (custom field is there but no values).
Big Decision
Website Production, Ecommerce & Digital Marketing in the UK
http://www.bigdecision.co.uk
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Big Decision
Website Production, Ecommerce & Digital Marketing in the UK
http://www.bigdecision.co.uk
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Big Decision
Website Production, Ecommerce & Digital Marketing in the UK
http://www.bigdecision.co.uk
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Users browsing this forum: No registered users and 517 guests