2017-10-09 71 views
-3

我们得到一对夫妇的Prestashop通告当客户将产品添加到购物车,即如下:未定义的常量在PHP

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

代码(行83),此是指如下:

/*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; 
    } 

任何人都可以帮忙吗?我们似乎无法找到问题所在。

+4

将'id_customization_field_height'更改为'$ id_customization_field_height' ...对'id_customization_field_width'做同样的处理 –

+0

[参考 - 这个错误在PHP中意味着什么?](https://stackoverflow.com/questions/12769982 /参考什么,确实,这个误差均值功能于PHP) – FirstOne

回答

2

是什么: id_customization_field_width 和 id_customization_field_height

是有可能,它是:

$id_customization_field_width && $id_customization_field_height 

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