Norman2019 Posted July 22, 2019 Share Posted July 22, 2019 Hello, I use Presta 1.7.6 Unfortunately, no customer can invest more. He always gets that mistake. Even if I want to create it in the BO I get the Optin error. I hope you can serve me !? Thank you PreaastaShopException] Property Customer->optin is empty. at line 1004 in file classes/ObjectModel.php 999. } 1000. 1001. $message = $this->validateField($field, $this->$field); 1002. if ($message !== true) { 1003. if ($die) { 1004. throw new PrestaShopException($message); 1005. } 1006. 1007. return $error_return ? $message : false; 1008. } 1009. } ObjectModelCore->validateFields - [line 292 - classes/ObjectModel.php] 287. * 288. * @throws PrestaShopException 289. */ 290. public function getFields() 291. { 292. $this->validateFields(); 293. $fields = $this->formatFields(self::FORMAT_COMMON); 294. 295. // For retro compatibility 296. if (Shop::isTableAssociated($this->def['table'])) { 297. $fields = array_merge($fields, $this->getFieldsShop()); ObjectModelCore->getFields - [line 561 - classes/ObjectModel.php] 556. 557. // Database insertion 558. if (Shop::checkIdShopDefault($this->def['table'])) { 559. $this->id_shop_default = (in_array(Configuration::get('PS_SHOP_DEFAULT'), $id_shop_list) == true) ? Configuration::get('PS_SHOP_DEFAULT') : min($id_shop_list); 560. } 561. if (!$result = Db::getInstance()->insert($this->def['table'], $this->getFields(), $null_values)) { 562. return false; 563. } 564. 565. // Get object id in database 566. $this->id = Db::getInstance()->Insert_ID(); ObjectModelCore->add - [line 262 - classes/Customer.php] - [2 Arguments] 257. 258. /* Can't create a guest customer, if this feature is disabled */ 259. if ($this->is_guest && !Configuration::get('PS_GUEST_CHECKOUT_ENABLED')) { 260. return false; 261. } 262. $success = parent::add($autoDate, $nullValues); 263. $this->updateGroup($this->groupBox); 264. 265. return $success; 266. } 267. CustomerCore->add - [line 516 - classes/ObjectModel.php] - [2 Arguments] 511. * 512. * @throws PrestaShopException 513. */ 514. public function save($null_values = false, $auto_date = true) 515. { 516. return (int) $this->id > 0 ? $this->update($null_values) : $this->add($auto_date, $null_values); 517. } 518. 519. /** 520. * Adds current object to the database. 521. * ObjectModelCore->save - [line 195 - classes/form/CustomerPersister.php] 190. ); 191. 192. return false; 193. } 194. 195. $ok = $customer->save(); 196. 197. if ($ok) { 198. $this->context->updateCustomer($customer); 199. $this->context->cart->update(); 200. $this->sendConfirmationMail($customer); CustomerPersisterCore->create - [line 59 - classes/form/CustomerPersister.php] - [2 Arguments] 54. public function save(Customer $customer, $clearTextPassword, $newPassword = '', $passwordRequired = true) 55. { 56. if ($customer->id) { 57. return $this->update($customer, $clearTextPassword, $newPassword, $passwordRequired); 58. } else { 59. return $this->create($customer, $clearTextPassword); 60. } 61. } 62. 63. private function update(Customer $customer, $clearTextPassword, $newPassword, $passwordRequired = true) 64. { CustomerPersisterCore->save - [line 196 - classes/form/CustomerForm.php] - [4 Arguments] 191. 192. $ok = $this->customerPersister->save( 193. $this->getCustomer(), 194. $clearTextPassword, 195. $newPassword, 196. $this->passwordRequired 197. ); 198. 199. if (!$ok) { 200. foreach ($this->customerPersister->getErrors() as $field => $errors) { 201. $this->formFields[$field]->setErrors($errors); CustomerFormCore->submit - [line 60 - controllers/front/AuthController.php] 55. function ($carry, $item) { 56. return $carry && $item; 57. }, 58. true 59. ); 60. if ($hookResult && $register_form->submit()) { 61. $should_redirect = true; 62. } 63. } 64. 65. $this->context->smarty->assign([ AuthControllerCore->initContent - [line 291 - classes/controller/Controller.php] 286. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) { 287. $this->initHeader(); 288. } 289. 290. if ($this->viewAccess()) { 291. $this->initContent(); 292. } else { 293. $this->errors[] = $this->trans('Access denied.', array(), 'Admin.Notifications.Error'); 294. } 295. 296. if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className))) { ControllerCore->run - [line 515 - classes/Dispatcher.php] 510. if (isset($params_hook_action_dispatcher)) { 511. Hook::exec('actionDispatcher', $params_hook_action_dispatcher); 512. } 513. 514. // Running controller 515. $controller->run(); 516. 517. // Execute hook dispatcher after 518. if (isset($params_hook_action_dispatcher)) { 519. Hook::exec('actionDispatcherAfter', $params_hook_action_dispatcher); 520. } DispatcherCore->dispatch - [line 28 - index.php] 23. * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) 24. * International Registered Trademark & Property of PrestaShop SA 25. */ 26. 27. require dirname(__FILE__).'/config/config.inc.php'; 28. Dispatcher::getInstance()->dispatch(); Hello, I use Presta 1.7.6 Unfortunately, no customer can invest more. He always gets that mistake. Even if I want to create it in the BO I get the Optin error. I hope you can serve me !? Thank you Link to comment Share on other sites More sharing options...
jhon111 Posted December 18, 2019 Share Posted December 18, 2019 I had the same problem and spent a night complete trying to find the solution,i waent to my bed very tired but at the follow morning i found the solution that work for me here https://www.sunnytoo.com/forums/topic/error-500-property-customer I hope this help to another people thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now