From c2963c3e7afbc24713ae96d7a48f6498bc405bb5 Mon Sep 17 00:00:00 2001 From: 4Giedrius <4giedrius@gmail.com> Date: Mon, 12 Jan 2015 17:52:26 +0200 Subject: [PATCH] Added button to remove item from cart in popup --- .../html_client/mod_orderbutton_checkout.phtml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/bb-modules/Orderbutton/html_client/mod_orderbutton_checkout.phtml b/src/bb-modules/Orderbutton/html_client/mod_orderbutton_checkout.phtml index 6b9a4b2fb..03ac9643c 100644 --- a/src/bb-modules/Orderbutton/html_client/mod_orderbutton_checkout.phtml +++ b/src/bb-modules/Orderbutton/html_client/mod_orderbutton_checkout.phtml @@ -12,6 +12,7 @@ {% trans 'Product' %} {% trans 'Price' %} + @@ -35,6 +36,7 @@ {{ (item.price * item.quantity) | money_convert }} {% endif %} + {% if request.show_custom_form_values %} @@ -187,4 +189,18 @@ }); }); + + $('.remove-cart-item').click(function(e){ + e.preventDefault(); + var btn = $(this); + if (confirm('{% trans 'Are you sure you want to remove this item from cart?' %}')){ + var item_id = $(btn).attr('data-cart-item-id'); + bb.post("guest/cart/remove_item", {id: item_id}, function(r){ + bb.msg("{% trans 'Item was removed from cart' %}"); + location.reload(false); + }); + } + + + }); \ No newline at end of file