2017-10-09 73 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