fix: Discount Filters and Web templates

- Fixed discount filters (didn’t work after js render change)
- Fix Item Card Group template height and style
- Add placeholder to missing images in Product Category Cards template
- Code cleanup
This commit is contained in:
marination
2021-05-25 01:35:22 +05:30
parent 03b88bd7b8
commit b29c5d6e84
15 changed files with 215 additions and 204 deletions

View File

@@ -1,9 +1,5 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
no_cache = 1
import frappe
from erpnext.utilities.product import get_price
from erpnext.e_commerce.shopping_cart.cart import _set_price_list
@@ -32,6 +28,7 @@ def get_context(context):
context.items = items
context.settings = settings
context.no_cache = 1
def get_stock_availability(item_code, warehouse):
stock_qty = frappe.utils.flt(
@@ -42,7 +39,7 @@ def get_stock_availability(item_code, warehouse):
},
"actual_qty")
)
return True if stock_qty else False
return bool(stock_qty)
def get_wishlist_items():
if frappe.db.exists("Wishlist", frappe.session.user):
@@ -53,5 +50,5 @@ def get_wishlist_items():
from
`tabWishlist Items`
where
parent=%(user)s""" % {"user": frappe.db.escape(frappe.session.user)}, as_dict=1)
parent=%(user)s""", {"user": frappe.session.user}, as_dict=1)
return