fix: Discount Filtes & Filter behaviour

- Client: Maintain state where listing is re-rendered due filter trigger
- Client: Handle binding/restoring discount filters separately on filter trigger
- Client: Placeholder Image for search results
- If any filter is checked, query and display items from page 1
- Query Engine: Smaller functions and handle discount filter properly
- Added index on item group and brand for Website item
This commit is contained in:
marination
2021-07-08 19:34:07 +05:30
parent f39c6db08a
commit 9920747a26
7 changed files with 195 additions and 80 deletions

View File

@@ -18,11 +18,17 @@ def get_product_filter_data():
attribute_filters = frappe.parse_json(frappe.form_dict.attribute_filters)
start = cint(frappe.parse_json(frappe.form_dict.start)) if frappe.form_dict.start else 0
item_group = frappe.form_dict.item_group
from_filters = frappe.parse_json(frappe.form_dict.from_filters)
else:
search, attribute_filters, item_group = None, None, None
search, attribute_filters, item_group, from_filters = None, None, None, None
field_filters = {}
start = 0
if from_filters:
# if filter is checked, go to start
# and show filtered items from page 1
start = 0
sub_categories = []
if item_group:
field_filters['item_group'] = item_group