ales699 Posted May 15, 2017 Share Posted May 15, 2017 Holaa! me ocurre un error cuando intento completar la compra de un pedido ya en el primer paso de darle a siguiente despues de poner mi información de contacto y demás. He puesto prestashop en modo depuración y me sale esto: [PrestaShopException]Property Address->dni is emptyat line 915 in file classes/ObjectModel.php 910. }911.912. $message = $this->validateField($field, $this->$field);913. if ($message !== true) {914. if ($die) {915. throw new PrestaShopException($message);916. }917. return $error_return ? $message : false;918. }919. }920. ObjectModelCore->validateFields - [line 248 - classes/ObjectModel.php]243. * @return array All object fields244. * @throws PrestaShopException245. */246. public function getFields()247. {248. $this->validateFields();249. $fields = $this->formatFields(self::FORMAT_COMMON);250.251. // For retro compatibility252. if (Shop::isTableAssociated($this->def['table'])) {253. $fields = array_merge($fields, $this->getFieldsShop()); ObjectModelCore->getFields - [line 489 - classes/ObjectModel.php]484.485. // Database insertion486. if (Shop::checkIdShopDefault($this->def['table'])) {487. $this->id_shop_default = (in_array(Configuration::get('PS_SHOP_DEFAULT'), $id_shop_list) == true) ? Configuration::get('PS_SHOP_DEFAULT') : min($id_shop_list);488. }489. if (!$result = Db::getInstance()->insert($this->def['table'], $this->getFields(), $null_values)) {490. return false;491. }492.493. // Get object id in database494. $this->id = Db::getInstance()->Insert_ID(); ObjectModelCore->add - [line 176 - classes/Address.php] - [2 Arguments]171. /**172. * @see ObjectModel::add()173. */174. public function add($autodate = true, $null_values = false)175. {176. if (!parent::add($autodate, $null_values)) {177. return false;178. }179.180. if (Validate::isUnsignedId($this->id_customer)) {181. Customer::resetAddressCache($this->id_customer, $this->id); AddressCore->add - [line 447 - classes/ObjectModel.php] - [2 Arguments]442. * @return bool Insertion result443. * @throws PrestaShopException444. */445. public function save($null_values = false, $auto_date = true)446. {447. return (int)$this->id > 0 ? $this->update($null_values) : $this->add($auto_date, $null_values);448. }449.450. /**451. * Adds current object to the database452. * ObjectModelCore->save - [line 73 - classes/form/CustomerAddressPersister.php]68.69. if ($address->isUsed()) {70. $old_address = new Address($address->id);71. $address->id = $address->id_address = null;72.73. return $address->save() && $old_address->delete();74. }75.76. return $address->save();77. }78. CustomerAddressPersisterCore->save - [line 145 - classes/form/CustomerAddressForm.php] - [2 Arguments]140. $this->address = $address;141.142. return $this->persister->save(143. $this->address,144. $this->getValue('token')145. );146. }147.148. public function getAddress()149. {150. return $this->address; CustomerAddressFormCore->submit - [line 111 - classes/checkout/CheckoutAddressesStep.php]106. 'firstname' => $this->getCheckoutSession()->getCustomer()->firstname,107. 'lastname' => $this->getCheckoutSession()->getCustomer()->lastname,108. ));109.110. if (isset($requestParams['saveAddress'])) {111. $saved = $this->addressForm->fillWith($requestParams)->submit();112. if (!$saved) {113. $this->step_is_current = true;114. $this->getCheckoutProcess()->setHasErrors(true);115. if ($requestParams['saveAddress'] === 'delivery') {116. $this->show_delivery_address_form = true; CheckoutAddressesStepCore->handleRequest - [line 57 - classes/checkout/CheckoutProcess.php] - [1 Arguments]52. }53.54. public function handleRequest(array $requestParameters = array())55. {56. foreach ($this->getSteps() as $step) {57. $step->handleRequest($requestParameters);58. }59.60. return $this;61. }62. CheckoutProcessCore->handleRequest - [line 200 - controllers/front/OrderController.php] - [1 Arguments]195. parent::initContent();196.197. $this->restorePersistedData($this->checkoutProcess);198. $this->checkoutProcess->handleRequest(199. Tools::getAllValues()200. );201.202. $presentedCart = $this->cart_presenter->present($this->context->cart);203.204. if (count($presentedCart['products']) <= 0 || $presentedCart['minimalPurchaseRequired']) {205. Tools::redirect('index.php?controller=cart'); OrderControllerCore->initContent - [line 201 - classes/controller/Controller.php]196. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {197. $this->initHeader();198. }199.200. if ($this->viewAccess()) {201. $this->initContent();202. } else {203. $this->errors[] = Tools::displayError('Access denied.');204. }205.206. if (!$this->content_only && ($this->display_footer || (isset($this->className) && $this->className))) { ControllerCore->run - [line 366 - classes/Dispatcher.php]361. if (isset($params_hook_action_dispatcher)) {362. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);363. }364.365. // Running controller366. $controller->run();367. } catch (PrestaShopException $e) {368. $e->displayMessage();369. }370. }371. DispatcherCore->dispatch - [line 28 - index.php]23. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)24. * International Registered Trademark & Property of PrestaShop SA25. */26.27. require(dirname(__FILE__).'/config/config.inc.php');28. Dispatcher::getInstance()->dispatch(); Alguna idea??? Link to comment Share on other sites More sharing options...
jesa Posted May 15, 2017 Share Posted May 15, 2017 Tu problema es que no estás metiendo el dni o al menos eso indica el error. Lo has puesto como campo no obligatorio? en ningún caso debería de darte este error, es decir o bien te muestra un mensaje por pantalla indicando al cliente que debe introducir el dni o lo crea porque no es obligatorio. Parece que puede ser un bug de esta versión. Link to comment Share on other sites More sharing options...
ales699 Posted May 15, 2017 Author Share Posted May 15, 2017 En teoría no lo pido en el formulario. Dónde miro para saber si esta marcado como obligatorio? Gracias por tu respuesta Link to comment Share on other sites More sharing options...
jesa Posted May 15, 2017 Share Posted May 15, 2017 Tienes que ir a paises y seleccionar el país en cuestión con el que estés probando. En la ficha te sale un check para decir si es obligatorio el número de identificación fiscal. De todos modos me parece un tanto extraño que no te aparezca y te de error, no se si será que has tocado algo de código, tienes una plantilla comprada,... Link to comment Share on other sites More sharing options...
ales699 Posted May 15, 2017 Author Share Posted May 15, 2017 He intentado y nada. Código he tocado solamente aspectos visuales; theme.css, custom.css y category.tpl He intentado actualizar prestashop con 1click pero me da error en la base de datos y tengo que volver a restaurar todo con un backup. No se que que hacer... Link to comment Share on other sites More sharing options...
Diego Galma Posted March 8, 2018 Share Posted March 8, 2018 Muchachos el problema de la dirección es por el phone_mobile (creo que es un bug) Agréguenlo al sitio y verán que funciona... firstname lastname address1 address2 postcode city Country:name phone phone_mobile Yo tampoco puedo actualizar desde la versión 1.7.2.4 a 1.7.3 ... me da error Link to comment Share on other sites More sharing options...
Ramon AH Posted March 9, 2018 Share Posted March 9, 2018 A mi me ha pasado algo parecido: [PrestaShopException] Property Address->dni is empty.at line 944 in file classes/ObjectModel.php Un buen susto, pero solo era que habia puesto VAT en lugar de DNI en el pais. Internacional>Ubicaciones geograficas>Paises>Formato de dirección Con solo quitar el VAT desapareció el error. 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