-3

We are getting a couple of notices in prestashop when customers add products to cart, namely the following:

Impossible to add the product to the cart. textStatus: 'parsererror' errorThrown: 'SyntaxError: Unexpected token < in JSON at position 0' responseText:

Notice: Use of undefined constant id_customization_field_width - assumed 'id_customization_field_width' in /home/public_html/override/controllers/front/CartController.php on line 83

Notice: Use of undefined constant id_customization_field_height - assumed 'id_customization_field_height' in /home/public_html/override/controllers/front/CartController.php on line 83

The code (line 83) which this refers to is as follows:

/*add new customization cart*/
$id_customization = 0;
if ($this->_newCustomization && id_customization_field_width && id_customization_field_height) {
   if ($this->context->customer->isLogged()) {
       $id_adv = $this->context->cart->id_address_delivery;
   } else {
       $id_adv = 0;
   }

Can anyone help with this? We can't seem to find where the issue lies.

teeyo
  • 3,665
  • 3
  • 22
  • 37
  • 4
    change `id_customization_field_height ` to `$id_customization_field_height`...do the same with `id_customization_field_width` – B001ᛦ Oct 09 '17 at 14:42
  • Possible duplicate of [Reference - What does this error mean in PHP?](https://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php) – FirstOne Oct 09 '17 at 15:00

1 Answers1

2

what is: id_customization_field_width and id_customization_field_height

is it possible that it is:

$id_customization_field_width && $id_customization_field_height

or

$this->id_customization_field_width && $this->id_customization_field_height

?

Frank
  • 1,901
  • 20
  • 27