Jump to content

Calling controller through ajax in prestashop


Recommended Posts

I want to post some data to OrderController.php from a form in shopping-cart.tpl through ajax . How should I do it?

 

this is my code

 

var formData = $('#gift_voucher').serialize();
var data = {};
data.ajax = 1;
data.controller = "AdminAddresses";
data.formData = formData;
$.ajax({
url : "index.php?controller=Order&sentmailnow=1",
type: "POST",
data : data,
success: function(data)
{
alert(1);
 
}
});
 
Please help anyone.
Link to comment
Share on other sites

×
×
  • Create New...