Merge pull request #30258 from marination/sub-category-routing
fix: Sub-Category Routing in Item Group Page Listing pills
diff --git a/erpnext/e_commerce/product_ui/views.js b/erpnext/e_commerce/product_ui/views.js
index 1b5c440..6dce79d 100644
--- a/erpnext/e_commerce/product_ui/views.js
+++ b/erpnext/e_commerce/product_ui/views.js
@@ -495,7 +495,7 @@
categories.forEach(category => {
sub_group_html += `
- <a href="${ category.route || '#' }" style="text-decoration: none;">
+ <a href="/${ category.route || '#' }" style="text-decoration: none;">
<div class="category-pill">
${ category.name }
</div>
diff --git a/erpnext/public/scss/shopping_cart.scss b/erpnext/public/scss/shopping_cart.scss
index 666043b..019496d 100644
--- a/erpnext/public/scss/shopping_cart.scss
+++ b/erpnext/public/scss/shopping_cart.scss
@@ -569,15 +569,12 @@
}
.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 5c7194b..2c53246 100644
--- a/erpnext/setup/doctype/item_group/item_group.py
+++ b/erpnext/setup/doctype/item_group/item_group.py
@@ -132,7 +132,8 @@
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):