fix: Shop by category fixes (#34688)

* fix: Shop by category fixes

* chore: Update tests
This commit is contained in:
Deepesh Garg
2023-04-05 12:43:32 +05:30
committed by GitHub
parent f193393f57
commit 56f5078357
3 changed files with 25 additions and 4 deletions

View File

@@ -53,6 +53,7 @@ def get_tabs(categories):
def get_category_records(categories: list):
categorical_data = {}
website_item_meta = frappe.get_meta("Website Item", cached=True)
for c in categories:
if c == "item_group":
@@ -64,7 +65,16 @@ def get_category_records(categories: list):
continue
doctype = frappe.unscrub(c)
field_type = website_item_meta.get_field(c).fieldtype
if field_type == "Table MultiSelect":
child_doc = website_item_meta.get_field(c).options
for field in frappe.get_meta(child_doc, cached=True).fields:
if field.fieldtype == "Link" and field.reqd:
doctype = field.options
else:
doctype = website_item_meta.get_field(c).options
fields = ["name"]
try: