2015-10-14 142 views
1

嘿,我有一個的Prestashop 1.6.0.11和Ajax車自上週以來,一個問題錯誤使用Ajax購物車,當上附加的Prestashop產品

當我在「加入購物車」按鈕,單擊有頁上沒有任何行動,在標題中的購物車上。 (如果我刷新頁面,產品在購物車中)。

我在我的控制檯此錯誤:

Ajax的cart.js:329 =>遺漏的類型錯誤:無法讀取空的特性「hasError」

Ajax請求被髮送,但結果「空」:

https://www.prestashop.com/forums/uploads/monthly_10_2015/post-833314-0-21064100-1444814390.png

https://www.prestashop.com/forums/uploads/monthly_10_2015/post-833314-0-07732700-1444814388.png

編輯:

這裏是Ajax的cart.js JS代碼:

$.ajax({ 
     type: 'POST', 
     headers: { "cache-control": "no-cache" }, 
     url: baseUri + '?rand=' + new Date().getTime(), 
     async: true, 
     cache: false, 
     dataType : "json", 
     data: 'controller=cart&add=1&ajax=true&qty=' + ((quantity && quantity != null) ? quantity : '1') + '&id_product=' + idProduct + '&token=' + static_token + ((parseInt(idCombination) && idCombination != null) ? '&ipa=' + parseInt(idCombination): ''), 
     success: function(jsonData,textStatus,jqXHR) 
     { 
      // add appliance to whishlist module 
      if (whishlist && !jsonData.errors) 
       WishlistAddProductCart(whishlist[0], idProduct, idCombination, whishlist[1]); 

    /* line 329 => */ if (!jsonData.hasError) // <-- jsonData object is NULL , why ? 
      { 
      // ... 

在PHP中有一個的Prestashop它的工作,這一次沒有什麼區別。

編輯2:

我發現其中displayAjax程序停止()在CartController.php:

if (Tools::getIsset('summary')) // == false 
{ 

什麼是 '總結'?

有人有解決方案嗎?

+0

給我們看一些代碼。 –

+0

@NiranjanNRaju檢查! –

+0

是'ajax-cart.js'文件的代碼? –

回答

0

這是決心。

問題來自一個Smarty插件,它在某些TPL的開始處添加了一些字符。

所以,Json編碼返回錯誤。

相關問題