[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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user