Hoy hemos descubierto la existencia de un Error 500 al intentar realizar un pedido, exactamente tras presionar el botón Pasar por caja después de añadir el producto al carrito de compra. Vamos a solucionar este error 500.
Ya sabemos lo que asusta un Error 500 pero no os preocupéis porque todo tiene solución.
Lo primero que debemos hacer es averiguar porque se produce este error 500 y la mejor forma es Activar el Modo Depuración en Prestashop 1.7, que nos dará información importante. Si se trata del mismo error 500 que en nuestro caso, habréis obtenido un mensaje como el siguiente;
[PrestaShopException]
La propiedad Address->phone_mobile está vacía.
at line 944 in file classes/ObjectModel.php
Error phone_mobile está vacía
Si os fijais en el mensaje que lanza el depurador de errores observaréis que dice phone_mobile está vacía, pues ya sabemos a que se debe el error. Es posible que anteriormente hemos indicado que el teléfono móvil debe ser obligatorio en el formulario de contacto de nuevos clientes y en el formulario no aparece, por lo que se crea una incongruencia para Prestashop.
Solucionar error phone_mobile está vacía
Para solucionar este error podemos dejar de pedir el teléfono móvil como obligatorio en el formulario de registro, acción que podemos hacer desplegando el área Establecer los campos que quieras sean requeridos para esta sección que se encuentra en;
Ventas > Clientes > Direcciones
Debemos desactivar la opción phone_mobile y Guardar.
Con esta acción ya debería desaparecer este Error 500 phone_mobile está vacía. Y si quieres saber como traducir la palabra Estado por Provincia puedes leer nuestro artículo Traducir Estado por Provincia en Prestashop 1.7.
Error dni está vacía
Si tras solucionar el error phone_mobile está vacía os sigue apareciendo un error 500 tenemos que volver a activar el Modo Depuración de errores de Prestashop 1.7 y volver a reproducir el error para intentar ver de donde proviene.
En nuestro caso vuelve a tratarse de un problema con un dato del cliente que se determinó como obligatorio pero que no aparece en el formulario de registro, el DNI.
[PrestaShopException]
La propiedad Address->dni está vacía.
at line 944 in file classes/ObjectModel.php
Para solucionar este error dni está vacía debemos realizar la operación anterior en la que desactivamos la opción phone_mobile, pero ahora desactivando la opción dni.
Con estos pasos ya debe funcionar correctamente tu tienda sin dar el Error 500. No olvides limpiar caché y desactivar Módo Depuración.
Es un bug de esa versión.
Si fuera simplemente un fallo saltaría el aviso y no un error 500
Hola Juan, gracias por tu aclaración. Esperemos que solucionen lo antes posible este bug, mientras tanto podemos solucionarlo de esta forma. Un saludo
Hola! Yo tengo el problema del error 500 en el checkout. A la que pongo el campo phone como obligatorio des de direcciones, mes aparece el error 500 en el checkout. Tengo pueso phone en el formulario y lo pongo como obligatorio des de direcciones. Pero no me funciona. Alguna idea de lo que puede pasar y como solucionarlo?
Muchas gracias!
Hola Marc, siguiendo los pasos descritos en el post deberías de solucionar el problema, pero para tener más claro el error te aconsejamos usar el Modo Depuración. Puedes ver como hacerlo en.
https://vegaweb.es/activar-modo-depuracion-errores-prestashop-1-7/
Una vez que conozcas el error será más fácil intentar buscar la solución.
Gracias y un saludo
Hola, efectivamente el desactivarlos soluciona el error, pero ahora el problema está en que los clientes no siempre ponen el DNI y/o el teléfono de contacto por lo que genera un problema añadido, segú tengo entendido el DNI o CIF es obligatorio en las compras online, y si no tenemos el telefono el trasportista puede tener problemas en la entrega.
¿Hay alguna otra forma de solucionarlo?
He conseguido arreglar el problema del dni haciendo lo que indicáis pero ¿Cómo tendría que hacer para que el campo DNI apareciera en el formulario como obligatorio?
De esta forma tampoco saldría el error ¿no?
Gracias
Hola, a mi tambien me salta error 500 y al darle al modo debug me aparece lo siguiente y no sé como arreglarlo. alguna ayuda por favor?
Whoops, looks like something went wrong.
(1/1) ContextErrorException
Notice: Undefined index: name
in 16094ef07b757c6fa78285483832de331b404a9a_2.file.address-form.tpl.php line 62
at Block_2609729635edf90984a9182_38601500->callBlock(object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 248
at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_2609729635edf90984a9182_38601500), object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 184
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_2609729635edf90984a9182_38601500), object(Block_5566615755edf90984bf3e4_50561588))in smarty_internal_runtime_inheritance.php line 186
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_5566615755edf90984bf3e4_50561588))in smarty_internal_runtime_inheritance.php line 156
at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyDevTemplate), ‘Block_5566615755edf90984bf3e4_50561588’, ‘form_field’, 1)in 5a6ff399469e59a84473774088d2bfafce9d9366_2.file.address-form.tpl.php line 74
at Block_18699805635edf90984be8e7_87539347->callBlock(object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 248
at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_18699805635edf90984be8e7_87539347), object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 232
at Smarty_Internal_Runtime_Inheritance->callParent(object(SmartyDevTemplate), object(Block_14894708395edf90984ac860_11943357), ‘\'{block append}\»)in smarty_internal_runtime_inheritance.php line 181
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_14894708395edf90984ac860_11943357), object(Block_18699805635edf90984be8e7_87539347))in smarty_internal_runtime_inheritance.php line 186
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_18699805635edf90984be8e7_87539347))in smarty_internal_runtime_inheritance.php line 156
at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyDevTemplate), ‘Block_18699805635edf90984be8e7_87539347’, ‘form_fields’, 1)in 5a6ff399469e59a84473774088d2bfafce9d9366_2.file.address-form.tpl.php line 93
at Block_8875424945edf90984be475_47420859->callBlock(object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 248
at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_8875424945edf90984be475_47420859), object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 184
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_8875424945edf90984be475_47420859))in smarty_internal_runtime_inheritance.php line 156
at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyDevTemplate), ‘Block_8875424945edf90984be475_47420859’, ‘address_form_fields’, 1)in 5a6ff399469e59a84473774088d2bfafce9d9366_2.file.address-form.tpl.php line 178
at Block_13560701965edf90984bb972_66384329->callBlock(object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 248
at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_13560701965edf90984bb972_66384329), object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 184
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_13560701965edf90984bb972_66384329))in smarty_internal_runtime_inheritance.php line 156
at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyDevTemplate), ‘Block_13560701965edf90984bb972_66384329’, ‘address_form’)in 5a6ff399469e59a84473774088d2bfafce9d9366_2.file.address-form.tpl.php line 27
at content_5edf90984c1a13_51785158(object(SmartyDevTemplate))in smarty_template_resource_base.php line 123
at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(SmartyDevTemplate))in smarty_template_compiled.php line 114
at Smarty_Template_Compiled->render(object(SmartyDevTemplate))in smarty_internal_template.php line 216
at Smarty_Internal_Template->render()in smarty_internal_template.php line 385
at Smarty_Internal_Template->_subTemplateRender(‘customer/_partials/address-form.tpl’, null, null, 0, 31536000, array(), 2, false, null, null)in smarty_internal_runtime_inheritance.php line 125
at Smarty_Internal_Runtime_Inheritance->endChild(object(SmartyDevTemplate), ‘customer/_partials/address-form.tpl’)in 16094ef07b757c6fa78285483832de331b404a9a_2.file.address-form.tpl.php line 48
at content_5edf90984b2579_79937859(object(SmartyDevTemplate))in smarty_template_resource_base.php line 123
at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(SmartyDevTemplate))in smarty_template_compiled.php line 114
at Smarty_Template_Compiled->render(object(SmartyDevTemplate))in smarty_internal_template.php line 216
at Smarty_Internal_Template->render(false, 0)in smarty_internal_templatebase.php line 232
at Smarty_Internal_TemplateBase->_execute(object(SmartyDevTemplate), null, null, null, 0)in smarty_internal_templatebase.php line 116
at Smarty_Internal_TemplateBase->fetch(null, null, null, null, false, true, false)in SmartyDevTemplate.php line 40
at SmartyDevTemplateCore->fetch()in AbstractForm.php line 121
at AbstractFormCore->render(array(‘file’ => ‘checkout/_partials/address-form.tpl’, ‘ui’ => object(RenderableProxy), ‘use_same_address’ => true, ‘type’ => ‘delivery’, ‘form_has_continue_button’ => true))in RenderableProxy.php line 52
at RenderableProxy->render(array(‘file’ => ‘checkout/_partials/address-form.tpl’, ‘ui’ => object(RenderableProxy), ‘use_same_address’ => true, ‘type’ => ‘delivery’, ‘form_has_continue_button’ => true))in smartyfront.config.inc.php line 98
at smartyRender(array(‘file’ => ‘checkout/_partials/address-form.tpl’, ‘ui’ => object(RenderableProxy), ‘use_same_address’ => true, ‘type’ => ‘delivery’, ‘form_has_continue_button’ => true), object(SmartyDevTemplate))in SmartyLazyRegister.php line 83
at SmartyLazyRegister->__call(‘smartyRender’, array(array(‘file’ => ‘checkout/_partials/address-form.tpl’, ‘ui’ => object(RenderableProxy), ‘use_same_address’ => true, ‘type’ => ‘delivery’, ‘form_has_continue_button’ => true), object(SmartyDevTemplate)))in 967088f312b2747f45a907200e9f1fc278a1f6c9_2.file.addresses.tpl.php line 76
at Block_3185045255edf909848a4e9_88735626->callBlock(object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 248
at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_3185045255edf909848a4e9_88735626), object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 184
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_3185045255edf909848a4e9_88735626), object(Block_15686025435edf90983de695_88074417))in smarty_internal_runtime_inheritance.php line 186
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_15686025435edf90983de695_88074417))in smarty_internal_runtime_inheritance.php line 156
at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyDevTemplate), ‘Block_15686025435edf90983de695_88074417’, ‘step_content’, 1)in 578b3793e56eb7c0d544dd93169b780f2c526a0e_2.file.checkout-step.tpl.php line 72
at Block_18290419755edf90983dc1c1_63187670->callBlock(object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 248
at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_18290419755edf90983dc1c1_63187670), object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 184
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_18290419755edf90983dc1c1_63187670))in smarty_internal_runtime_inheritance.php line 156
at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyDevTemplate), ‘Block_18290419755edf90983dc1c1_63187670’, ‘step’)in 578b3793e56eb7c0d544dd93169b780f2c526a0e_2.file.checkout-step.tpl.php line 26
at content_5edf90983deeb2_03963189(object(SmartyDevTemplate))in smarty_template_resource_base.php line 123
at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(SmartyDevTemplate))in smarty_template_compiled.php line 114
at Smarty_Template_Compiled->render(object(SmartyDevTemplate))in smarty_internal_template.php line 216
at Smarty_Internal_Template->render()in smarty_internal_template.php line 385
at Smarty_Internal_Template->_subTemplateRender(‘checkout/_partials/steps/checkout-step.tpl’, null, null, 0, 31536000, array(), 2, false, null, null)in smarty_internal_runtime_inheritance.php line 125
at Smarty_Internal_Runtime_Inheritance->endChild(object(SmartyDevTemplate), ‘checkout/_partials/steps/checkout-step.tpl’)in 967088f312b2747f45a907200e9f1fc278a1f6c9_2.file.addresses.tpl.php line 34
at content_5edf909849b872_55351797(object(SmartyDevTemplate))in smarty_template_resource_base.php line 123
at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(SmartyDevTemplate))in smarty_template_compiled.php line 114
at Smarty_Template_Compiled->render(object(SmartyDevTemplate))in smarty_internal_template.php line 216
at Smarty_Internal_Template->render(false, 0)in smarty_internal_templatebase.php line 232
at Smarty_Internal_TemplateBase->_execute(object(SmartyDevTemplate), null, null, null, 0)in smarty_internal_templatebase.php line 116
at Smarty_Internal_TemplateBase->fetch(null, null, null, null, false, true, false)in SmartyDevTemplate.php line 40
at SmartyDevTemplateCore->fetch()in AbstractCheckoutStep.php line 96
at AbstractCheckoutStepCore->renderTemplate(‘checkout/_partials/steps/addresses.tpl’, array(‘identifier’ => ‘checkout-addresses-step’, ‘position’ => 2, ‘ui’ => object(RenderableProxy)), array(‘address_form’ => object(RenderableProxy), ‘use_same_address’ => true, ‘use_different_address_url’ => ‘http://pizzerialamina.es/es/pedido?use_same_address=0’, ‘new_address_delivery_url’ => ‘http://pizzerialamina.es/es/pedido?newAddress=delivery’, ‘new_address_invoice_url’ => ‘http://pizzerialamina.es/es/pedido?newAddress=invoice’, ‘id_address’ => 0, ‘id_address_delivery’ => 0, ‘id_address_invoice’ => 0, ‘show_delivery_address_form’ => true, ‘show_invoice_address_form’ => false, ‘form_has_continue_button’ => true, ‘not_valid_addresses’ => »))in CheckoutAddressesStep.php line 303
at CheckoutAddressesStepCore->render(array(‘identifier’ => ‘checkout-addresses-step’, ‘position’ => 2, ‘ui’ => object(RenderableProxy)))in RenderableProxy.php line 52
at RenderableProxy->render(array(‘identifier’ => ‘checkout-addresses-step’, ‘position’ => 2, ‘ui’ => object(RenderableProxy)))in smartyfront.config.inc.php line 98
at smartyRender(array(‘identifier’ => ‘checkout-addresses-step’, ‘position’ => 2, ‘ui’ => object(RenderableProxy)), object(SmartyDevTemplate))in SmartyLazyRegister.php line 83
at SmartyLazyRegister->__call(‘smartyRender’, array(array(‘identifier’ => ‘checkout-addresses-step’, ‘position’ => 2, ‘ui’ => object(RenderableProxy)), object(SmartyDevTemplate)))in 032e4e1616fee7b4a46d4c287d468f85e6e6fbe0_2.file.checkout-process.tpl.php line 28
at content_5edf90983b8478_65077453(object(SmartyDevTemplate))in smarty_template_resource_base.php line 123
at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(SmartyDevTemplate))in smarty_template_compiled.php line 114
at Smarty_Template_Compiled->render(object(SmartyDevTemplate))in smarty_internal_template.php line 216
at Smarty_Internal_Template->render(false, 0)in smarty_internal_templatebase.php line 232
at Smarty_Internal_TemplateBase->_execute(object(SmartyDevTemplate), null, null, null, 0)in smarty_internal_templatebase.php line 116
at Smarty_Internal_TemplateBase->fetch(null, null, null, null, false, true, false)in SmartyDevTemplate.php line 40
at SmartyDevTemplateCore->fetch()in CheckoutProcess.php line 112
at CheckoutProcessCore->render(array(‘file’ => ‘checkout/checkout-process.tpl’, ‘ui’ => object(RenderableProxy)))in RenderableProxy.php line 52
at RenderableProxy->render(array(‘file’ => ‘checkout/checkout-process.tpl’, ‘ui’ => object(RenderableProxy)))in smartyfront.config.inc.php line 98
at smartyRender(array(‘file’ => ‘checkout/checkout-process.tpl’, ‘ui’ => object(RenderableProxy)), object(SmartyDevTemplate))in SmartyLazyRegister.php line 83
at SmartyLazyRegister->__call(‘smartyRender’, array(array(‘file’ => ‘checkout/checkout-process.tpl’, ‘ui’ => object(RenderableProxy)), object(SmartyDevTemplate)))in fe6413e6807e474ab6bdb2d64f02c58c6d125263_2.file.checkout.tpl.php line 178
at Block_2056291145edf909832f907_12930062->callBlock(object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 248
at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_2056291145edf909832f907_12930062), object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 184
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_2056291145edf909832f907_12930062))in smarty_internal_runtime_inheritance.php line 156
at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyDevTemplate), ‘Block_2056291145edf909832f907_12930062’, ‘cart_summary’, 3)in fe6413e6807e474ab6bdb2d64f02c58c6d125263_2.file.checkout.tpl.php line 217
at Block_12963730925edf909832f482_39504895->callBlock(object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 248
at Smarty_Internal_Runtime_Inheritance->callBlock(object(Block_12963730925edf909832f482_39504895), object(SmartyDevTemplate))in smarty_internal_runtime_inheritance.php line 184
at Smarty_Internal_Runtime_Inheritance->process(object(SmartyDevTemplate), object(Block_12963730925edf909832f482_39504895))in smarty_internal_runtime_inheritance.php line 156
at Smarty_Internal_Runtime_Inheritance->instanceBlock(object(SmartyDevTemplate), ‘Block_12963730925edf909832f482_39504895’, ‘content’)in fe6413e6807e474ab6bdb2d64f02c58c6d125263_2.file.checkout.tpl.php line 71
at content_5edf9098335465_70928740(object(SmartyDevTemplate))in smarty_template_resource_base.php line 123
at Smarty_Template_Resource_Base->getRenderedTemplateCode(object(SmartyDevTemplate))in smarty_template_compiled.php line 114
at Smarty_Template_Compiled->render(object(SmartyDevTemplate))in smarty_internal_template.php line 216
at Smarty_Internal_Template->render(false, 0)in smarty_internal_templatebase.php line 232
at Smarty_Internal_TemplateBase->_execute(object(SmartyDevTemplate), null, ‘layouts/layout-full-width.tpl’, null, 0)in smarty_internal_templatebase.php line 116
at Smarty_Internal_TemplateBase->fetch(‘checkout/checkout.tpl’, null, ‘layouts/layout-full-width.tpl’, null, false, true, false)in SmartyDev.php line 40
at SmartyDev->fetch(‘checkout/checkout.tpl’, null, ‘layouts/layout-full-width.tpl’)in FrontController.php line 683
at FrontControllerCore->smartyOutputContent(‘checkout/checkout.tpl’)in FrontController.php line 667
at FrontControllerCore->display()in Controller.php line 312
at ControllerCore->run()in Dispatcher.php line 515
at DispatcherCore->dispatch()in index.php line 28
Muchas gracias
Hola Eider, prueba con el siguiente video
https://www.youtube.com/watch?v=eeeYUBybmiY