mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-23 13:23:00 +09:00
Added button to remove item from cart in popup
This commit is contained in:
1 parent
caa484e28e
commit
c2963c3e7a
1 file changed
+16
@@ -12,6 +12,7 @@
|
||||
<tr>
|
||||
<th>{% trans 'Product' %}</th>
|
||||
<th>{% trans 'Price' %}</th>
|
||||
<th style="width: 3%; text-align: center"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -35,6 +36,7 @@
|
||||
{{ (item.price * item.quantity) | money_convert }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td><button data-cart-item-id="{{ item.id }}" class="btn btn-inverse btn-mini remove-cart-item" title="{% trans 'Remove item' %}"><strong><i class="awe-remove"></i></strong></button></td>
|
||||
</tr>
|
||||
|
||||
{% 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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
Reference in new issue
Block a user