WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Bakery Shop => Topic started by: sky writer on October 01, 2015, 04:13:31 PM

Title: Delete Item without page refresh
Post by: sky writer on October 01, 2015, 04:13:31 PM
Is it possible for the page not to refresh after deleting an item from the cart?  I am not using minicart.
I know there seemed to be this kind of functionality being worked on (for minicart, anyway) some time ago, but it looks like it was abandoned - http://forum.WebsiteBaker.org/index.php/topic,18490.msg123213.html#msg123213
Title: Re: Delete Item without page refresh
Post by: freeSbee on October 05, 2015, 01:12:28 PM
Hi sky writer

You could, using Ajax, but this requires a greater programing effort. You can, however, set the quantity field value to 0 without reloading the page.

Go to the file /bakery/frontend.js, about line 21. Replace the js code:
Code: [Select]
function mod_bakery_delete_item_f(id) {
if (id != '') {
document.getElementById('id_' + id).value = 0;
document.getElementById('update').click();
}
}

by:
Code: [Select]
function mod_bakery_delete_item_f(id) {
if (id != '') {
document.getElementById('id_' + id).value = 0;
/* document.getElementById('update').click(); */
}
}

Regards Christoph