keithg

remove all items from cart in prestashop 1.7

<a class="btn btn-primary" style="float:right" id="removeAll" href="javascript:void(0)">   Empty Cart </a> in js file $(document).ready(function() { 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(); } }) }); }...Read more …
keithg

Create Url (short url) in prestashop 1. 7

With Module you can make a link in tpl. spstepcheckout is the module name ane ajax is front controller . old way : {$link->getModuleLink(‘spstepcheckout’,’ajax’)} new way : {url entity=’module’ name=’spstepcheckout’ controller=’ajax’ params=[‘edited’ => 1, ‘id’ => $id]} Without Module make a controller link. cart is the controller name and pass parameter...Read more …