From a56fd20ab4d8c5e10787d8725f5a73a0758f466f Mon Sep 17 00:00:00 2001 From: marination Date: Tue, 15 Mar 2022 16:27:52 +0530 Subject: [PATCH] fix: Sub-Categpry Routing in Item Group Page Listing pills - Use absolute route even 3-4 sub-category levels down - Remove scroll from category pills due to accessibility issues - Arrange sub-category pills alphabetically (cherry picked from commit 8264d6b0bcef5d9c7900f652c4554f95572aa202) --- erpnext/e_commerce/product_ui/views.js | 2 +- erpnext/public/scss/shopping_cart.scss | 9 +++------ erpnext/setup/doctype/item_group/item_group.py | 3 ++- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/erpnext/e_commerce/product_ui/views.js b/erpnext/e_commerce/product_ui/views.js index 99b91afac17..cc51718c47f 100644 --- a/erpnext/e_commerce/product_ui/views.js +++ b/erpnext/e_commerce/product_ui/views.js @@ -501,7 +501,7 @@ erpnext.ProductView = class { categories.forEach(category => { sub_group_html += ` - +
${ category.name }
diff --git a/erpnext/public/scss/shopping_cart.scss b/erpnext/public/scss/shopping_cart.scss index b743504a527..ff2482d3f64 100644 --- a/erpnext/public/scss/shopping_cart.scss +++ b/erpnext/public/scss/shopping_cart.scss @@ -569,15 +569,12 @@ body.product-page { } .scroll-categories { - white-space: nowrap; - overflow-x: auto; - .category-pill { - margin: 0px 4px; display: inline-block; - padding: 6px 12px; - background-color: #ecf5fe; width: fit-content; + padding: 6px 12px; + margin-bottom: 8px; + background-color: #ecf5fe; font-size: 14px; border-radius: 18px; color: var(--blue-500); diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index 5bcd0e4e21e..91b2f4f974f 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -133,7 +133,8 @@ def get_child_groups_for_website(item_group_name, immediate=False, include_self= return frappe.get_all( "Item Group", filters=filters, - fields=["name", "route"] + fields=["name", "route"], + order_by="name" ) def get_child_item_groups(item_group_name):