From 2602fc633b5246e1b53bbdcf1a92e0ffd075cd58 Mon Sep 17 00:00:00 2001 From: Devin Slauenwhite Date: Fri, 31 Dec 2021 09:58:00 -0500 Subject: [PATCH] fix(e-commerce): shopping cart total quantity (#29076) * fix: shopping cart total quantity * fix: linter error --- erpnext/e_commerce/shopping_cart/cart.py | 2 +- .../loan_management/doctype/loan_repayment/loan_repayment.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/e_commerce/shopping_cart/cart.py b/erpnext/e_commerce/shopping_cart/cart.py index cd6bd03edf7..03aa36fa883 100644 --- a/erpnext/e_commerce/shopping_cart/cart.py +++ b/erpnext/e_commerce/shopping_cart/cart.py @@ -24,7 +24,7 @@ def set_cart_count(quotation=None): if cint(frappe.db.get_singles_value("E Commerce Settings", "enabled")): if not quotation: quotation = _get_cart_quotation() - cart_count = cstr(len(quotation.get("items"))) + cart_count = cstr(cint(quotation.get("total_qty"))) if hasattr(frappe.local, "cookie_manager"): frappe.local.cookie_manager.set_cookie("cart_count", cart_count) diff --git a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py index 151cf58965c..ceaaecb93a0 100644 --- a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py +++ b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py @@ -4,7 +4,7 @@ import frappe from frappe import _ -from frappe.utils import add_days, add_months, cint, date_diff, flt, get_datetime, getdate +from frappe.utils import add_days, cint, date_diff, flt, get_datetime, getdate from six import iteritems import erpnext