Jump to content

DiegolPerez

New Members
  • Posts

    2
  • Joined

  • Last visited

DiegolPerez's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi community, I'm working with prestashop 1.7.6 with classic theme. I'm working in processChangeProductInCart() function of CartController.php, for my own functionality but the errors notifications of this controller not show in my store, for example this error of availability of product: if ('update' !== $mode && $this->shouldAvailabilityErrorBeRaised($product, $qty_to_check)) { $this->{$ErrorKey}[] = $this->trans( 'The item %product% in your cart is no longer available in this quantity. You cannot proceed with your order until the quantity is adjusted.', array('%product%' => $product->name), 'Shop.Notifications.Error' ); } In debug mode of Firefox in JSON response I get it: {"JSON" :{"hasError":true,"errors":["The item Mug the best in your cart is no longer available in this quantity. You cannot proceed with your order until the quantity is adjusted."],"quantity":5000} } but not show error notification in store, how do I show this errors in my store? or its a bug?
  2. Buenos días comunidad, Estoy utilizando prestashop 1.7.6 estable, con el tema por defecto que sería el classic. Lo que intento hacer es modificar la función processChangeProductInCart() de CartController.php para que tenga una funcionalidad que me permita avisar al usuario que le hacen falta n productos para llegar a 100. Sin embargo al hacer un debug me di cuenta que ninguno de los errores registrados mediante este controlador aparecen en mi tienda, por ejemplo este disponibilidad: if ('update' !== $mode && $this->shouldAvailabilityErrorBeRaised($product, $qty_to_check)) { $this->{$ErrorKey}[] = $this->trans( 'The item %product% in your cart is no longer available in this quantity. You cannot proceed with your order until the quantity is adjusted.', array('%product%' => $product->name), 'Shop.Notifications.Error' ); } Al hacer un debug tengo dentro de mis respuestas de JSON estos parámetros enviados al ajax pero no logro hacerlos aparecer al usuario en mi tienda, y simplemente sigue al checkout sin añadir al producto. Cómo hago para mostar estos errores? es un bug? hay que incluir algo para que se muestre? Esta es la respuesta de JSON {"JSON" :{"hasError":true,"errors":["The item Mug the best in your cart is no longer available in this quantity. You cannot proceed with your order until the quantity is adjusted."],"quantity":5000} }
×
×
  • Create New...