问题
I tried sending to my module prestashop addons. I got a message "Technical validation has been declined". This message contain the
You need to add a token to your ajax file.
My ajax script is:
$.ajax({
type: "post",
url : "../modules/priceupdate/ajax-call.php",
data: "ajax=ps_ajax_update_prices",
success : function(response){
$('#update-ajaxresponse').html(response)
}
});
Regards
回答1:
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)
}
});
来源:https://stackoverflow.com/questions/40945551/prestashop-add-a-token-to-ajax-file