remove cart using ajax
AJAX CODE
current page name in js
site url in js
if(prestashop.page.page_name == 'cart')
{
$('#removeAll').click( function(e) {
e.preventDefault()
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
url: prestashop.urls.base_url + "cart",
async: true,
cache: false,
data: 'deleteAll=1&token=' + prestashop.token + '&ajax=true',
success: function(data){
window.location.reload();
}
})
});
}
Comments
Post a Comment