Prestashop将令牌添加到Ajax文件 [英] Prestashop add a token to ajax file

查看:74
本文介绍了Prestashop将令牌添加到Ajax文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将prestashop插件发送到我的模块.我收到一条消息技术验证已被拒绝".此消息包含

I tried sending to my module prestashop addons. I got a message "Technical validation has been declined". This message contain the

您需要将令牌添加到ajax文件中.

我的ajax脚本是:

$.ajax({
        type: "post", 
        url : "../modules/priceupdate/ajax-call.php",
        data: "ajax=ps_ajax_update_prices",
        success : function(response){
            $('#update-ajaxresponse').html(response)
        }
    });

致谢

推荐答案

通常,令牌是由PrestaShop声明的,您应该仅在data中添加令牌:

Usually the token are declared by PrestaShop, you should to add only the token in your data:

$.ajax({
    type: "post", 
    url : "../modules/priceupdate/ajax-call.php",
    data: "ajax=ps_ajax_update_prices&token=" + token ,
    success : function(response){
        $('#update-ajaxresponse').html(response)
    }
});

这篇关于Prestashop将令牌添加到Ajax文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆