[fixes] display cart count only if item exist in cart

This commit is contained in:
Saurabh
2016-01-06 18:21:18 +05:30
parent 69f9975748
commit 403ad48364
2 changed files with 2 additions and 13 deletions

View File

@@ -4,13 +4,12 @@
// shopping cart
frappe.provide("shopping_cart");
$(function() {
frappe.ready(function() {
// update user
if(full_name) {
$('.navbar li[data-label="User"] a')
.html('<i class="icon-fixed-width icon-user"></i> ' + full_name);
}
// update login
shopping_cart.set_cart_count();
});
@@ -46,7 +45,7 @@ $.extend(shopping_cart, {
var $cart = $('.cart-icon');
var $badge = $cart.find("#cart-count");
if(cart_count === "0") {
if(parseInt(cart_count) === 0) {
$cart.css("display", "none");
}
else {