douxing8855 2013-02-13 02: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 03: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 KeiI中头文件找不到怎么解决
  • ¥15 QT6将音频采样数据转PCM
  • ¥15 本地安装org.Hs.eg.dby一直这样的图片报错如何解决?
  • ¥15 下面三个文件分别是OFDM波形的数据,我的思路公式和我写的成像算法代码,有没有人能帮我改一改,如何解决?
  • ¥15 Ubuntu打开gazebo模型调不出来,如何解决?
  • ¥100 有chang请一位会arm和dsp的朋友解读一个工程
  • ¥50 求代做一个阿里云百炼的小实验
  • ¥15 查询优化:A表100000行,B表2000 行,内存页大小只有20页,运行时3页,设计两个表等值连接的最简单的算法
  • ¥15 led数码显示控制(标签-流程图)
  • ¥20 为什么在复位后出现错误帧
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部