jquery - Link PHP with Ajax Magento 2 -
i'm trying create simple "register interest" action. have front end working i'm not sure how link ajax php file. put php file?
my current code ajax is:
$.ajax({ url: "register-interest.php", type: "get", datatype: "json", data: { type : "registerinterest", email : useremaillog, user : usernamelog, product : producttitle, sku : productsku }, success: function (response) { json.stringify(response); }, error: function (err) { json.stringify(err); }, complete : function() { //$('.user-accept').addclass('unhide'); loading(); } });
first check url variable correct or not , provide response data
success: function (response) { json.stringify(response); },
Comments
Post a Comment