Skip to content

Commit

Permalink
Remove cart products on post request #4723
Browse files Browse the repository at this point in the history
Review Id: 9863001
  • Loading branch information
Gaurav Goyal committed Jun 28, 2014
1 parent a239c80 commit defb5bb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1374,3 +1374,8 @@ span.text-success, span.text-warning, span.text-danger, span.text-info{
color: #b94a48;
text-decoration: none;
}
/* shopping_cart.jinja */
.action span i:hover{
cursor: pointer;
color: #AD4242;
}
11 changes: 10 additions & 1 deletion templates/webshop/shopping-cart.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
</td>
<td class="action">
<a href="" data-toggle="tooltip" data-placement="top" title="" data-original-title="Move to Wishlist"><i class="fa fa-heart"></i></a>
<a href="{{ url_for('nereid.cart.delete_from_cart', line=line.id) }}" data-toggle="tooltip" data-placement="top" title="" data-original-title="{{ _('Remove Item') }}"><i class="fa fa-trash-o"></i></a>
<span data-url="{{ url_for('nereid.cart.delete_from_cart', line=line.id) }}" data-toggle="tooltip" data-placement="top" title="" data-original-title="{{ _('Remove Item') }}" class="remove_from_cart"><i class="fa fa-trash-o"></i></span>
</td>
</tr>
{% endfor %}
Expand Down Expand Up @@ -203,6 +203,15 @@
$("a.clear-cart").click(function(){
$(this).button('loading');
});
$('.remove_from_cart').on('click', function(){
$.ajax({
type: "POST",
url: $(this).data("url"),
})
.success(function(){
location.reload();
});
});
});
</script>
{% endblock script_tags %}

0 comments on commit defb5bb

Please sign in to comment.