douxing8855 2013-02-13 10:50
浏览 22
已采纳

Prestashop模块调试

I am newbie in Prestashop module development so sorry if it is a fool question... I have been reading the docs but I haven't found what I am looking for so here I go,

I'd like to show a message on the screen (just for debugging purpose) with different context vars and so forth when actionCartSave. Something similar to "console.log()" or "alert()" in js.

Impossible to add the product to the cart.

textStatus: 'parsererror'

errorThrown: 'SyntaxError: JSON Parse error: Unrecognized token '<''

responseText:

< xmp style="text-align: left;" > message: < /xmp>

*{

"products": [...] *

I have already test this code:

public function hookActionCartSave( $params )
{
     ppp('message: ');
     return true;
}

...inside the module class definition but I am getting this error when I add a product to the cart:

I get this text in a different browser window.

So please, what is the best way to go?

Hope everything is clear. Thanks.

  • 写回答

2条回答 默认 最新

  • drex88669 2013-02-13 11:04
    关注

    What you have done is correct, this error message is something thrown by javascript running in your browser since the additional information you are printing out using ppp isn't valid JSON.

    If you use Chrome, use developer tools and select the Network tab. You will see the ajax call here. You can inspect this call in more detail by clicking on it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 ADS生成的微带线为什么是蓝色空心的
  • ¥15 求一下解题思路,完全不懂
  • ¥15 tensorflow
  • ¥15 densenet网络结构中,特征以cat方式复用后是怎么进行误差回传的
  • ¥15 STM32G471芯片spi设置了8位,总是发送16位
  • ¥15 R语言并行计算beta-NTI中tree文件的类型
  • ¥15 如何解读marsbar导出的ROI数据?
  • ¥20 求友友协助弄一下基于STC89C52单片机的声光控制灯原理图
  • ¥15 arduino双向交通灯设计
  • ¥15 有没有会粒子群算法的大能(○゜ε^○)求带不会出收敛图😭