mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 15:39:20 +00:00
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:
@@ -73,10 +73,10 @@
|
||||
|
||||
{% if is_featured %}
|
||||
<div class="col-sm-{{ col_size*2 }} item-card">
|
||||
<div class="card featured-item {{ align_items_class }}">
|
||||
<div class="card featured-item {{ align_items_class }}" style="height: 360px;">
|
||||
{% if image %}
|
||||
<div class="row no-gutters">
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-5 ml-4">
|
||||
<img class="card-img" src="{{ image }}" alt="{{ title }}">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
@@ -92,7 +92,7 @@
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="col-sm-{{ col_size }} item-card">
|
||||
<div class="card {{ align_items_class }}">
|
||||
<div class="card {{ align_items_class }}" style="height: 360px;">
|
||||
{% if image %}
|
||||
<div class="card-img-container">
|
||||
<a href="/{{ item.route or '#' }}" style="text-decoration: none;">
|
||||
@@ -119,19 +119,17 @@
|
||||
'text-left': align == 'Left' or is_featured,
|
||||
}) -%}
|
||||
<div class="card-body {{ align_class }}" style="width:100%">
|
||||
<div style="margin-top: 16px; display: flex;">
|
||||
<div class="mt-4">
|
||||
<a href="/{{ item.route or '#' }}">
|
||||
<div class="product-title">
|
||||
{{ title or '' }}
|
||||
{% if item.in_stock %}
|
||||
<span class="indicator {{ item.in_stock }} card-indicator"></span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{% if is_featured %}
|
||||
<div class="product-price">{{ item.formatted_price or '' }}</div>
|
||||
<div class="product-description ellipsis">{{ description or '' }}</div>
|
||||
<div class="product-description ellipsis text-muted" style="white-space: normal;">
|
||||
{{ description or '' }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="product-category">{{ item.item_group or '' }}</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
# Copyright (c) 2015, 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.e_commerce.doctype.item_review.item_review import get_item_reviews
|
||||
|
||||
def get_context(context):
|
||||
context.no_cache = 1
|
||||
context.full_page = True
|
||||
context.reviews = None
|
||||
|
||||
if frappe.form_dict and frappe.form_dict.get("item_code"):
|
||||
context.item_code = frappe.form_dict.get("item_code")
|
||||
context.web_item = frappe.db.get_value("Website Item", {"item_code": context.item_code}, "name")
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user