[FIX] website_sale: hide cart count and checkout button

When the cart is emptied (e.g. set quantity to zero), we need to hide
the cart count and the ckeckout button.
This commit is contained in:
Nicolas Martinelli
2015-10-02 10:23:54 +02:00
parent b1965f191a
commit 13122e4da4
@@ -155,7 +155,13 @@ $('.oe_website_sale').each(function () {
return;
}
var $q = $(".my_cart_quantity");
$q.parent().parent().removeClass("hidden", !data.quantity);
if (data.cart_quantity) {
$q.parent().parent().removeClass("hidden");
}
else {
$q.parent().parent().addClass("hidden");
$('a[href^="/shop/checkout"]').addClass("hidden")
}
$q.html(data.cart_quantity).hide().fadeIn(600);
$input.val(data.quantity);