Chore: Miscellaneous UI review changes
- Added bg (variable) to pages, card space separation visible
- Removed `show brand line` in settings, shown by default
- Re-arranged settings by importance
- View toggling primary colour is grey
- Only populate recent searches on successful search
- Hit only one server side api, once while searching
- List view primary button float right
- Discounts takes upper limit eg. 10% and below
- Navbar icons only wiggle on qty increase in cart/wishlist
- Pay button in SO portal
- Remove bottom white space below item full page image, min-height fits to content
- List view vertical space between heading and item code
- Empty offer subtitle handled
diff --git a/erpnext/templates/pages/cart.py b/erpnext/templates/pages/cart.py
index 1f0cd5c..cadb46f 100644
--- a/erpnext/templates/pages/cart.py
+++ b/erpnext/templates/pages/cart.py
@@ -7,4 +7,5 @@
def get_context(context):
+ context.body_class = "product-page"
context.update(get_cart_quotation())
diff --git a/erpnext/templates/pages/customer_reviews.py b/erpnext/templates/pages/customer_reviews.py
index 02c03d3..10cb28a 100644
--- a/erpnext/templates/pages/customer_reviews.py
+++ b/erpnext/templates/pages/customer_reviews.py
@@ -6,6 +6,7 @@
from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import get_shopping_cart_settings
def get_context(context):
+ context.body_class = "product-page"
context.no_cache = 1
context.full_page = True
context.reviews = None
@@ -14,6 +15,7 @@
context.web_item = frappe.form_dict.get("web_item")
context.user_is_customer = check_if_user_is_customer()
context.enable_reviews = get_shopping_cart_settings().enable_reviews
+
if context.enable_reviews:
reviews_data = get_item_reviews(context.web_item)
context.update(reviews_data)
diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html
index 28faea8..19191d8 100644
--- a/erpnext/templates/pages/order.html
+++ b/erpnext/templates/pages/order.html
@@ -139,9 +139,12 @@
<div class="form-column col-sm-6">
<div id="loyalty-points-status" style="text-align: right"></div>
<div class="page-header-actions-block" data-html-block="header-actions">
- <p>
+ <p class="mt-2" style="float: right;">
<a href="/api/method/erpnext.accounts.doctype.payment_request.payment_request.make_payment_request?dn={{ doc.name }}&dt={{ doc.doctype }}&submit_doc=1&order_type=Shopping Cart"
- class="btn btn-primary btn-sm" id="pay-for-order">{{ _("Pay") }} {{ doc.get_formatted("grand_total") }} </a>
+ class="btn btn-primary btn-sm"
+ id="pay-for-order">
+ {{ _("Pay") }} {{ doc.get_formatted("grand_total") }}
+ </a>
</p>
</div>
</div>
diff --git a/erpnext/templates/pages/product_search.py b/erpnext/templates/pages/product_search.py
index 00aace4..bfee793 100644
--- a/erpnext/templates/pages/product_search.py
+++ b/erpnext/templates/pages/product_search.py
@@ -59,7 +59,17 @@
}, as_dict=1)
@frappe.whitelist(allow_guest=True)
-def search(query, limit=10, fuzzy_search=True):
+def search(query):
+ product_results = product_search(query)
+ category_results = get_category_suggestions(query)
+
+ return {
+ "product_results": product_results.get("results") or [],
+ "category_results": category_results.get("results") or []
+ }
+
+@frappe.whitelist(allow_guest=True)
+def product_search(query, limit=10, fuzzy_search=True):
search_results = {"from_redisearch": True, "results": []}
if not is_search_module_loaded():
diff --git a/erpnext/templates/pages/wishlist.py b/erpnext/templates/pages/wishlist.py
index 9fa83a9..339e51b 100644
--- a/erpnext/templates/pages/wishlist.py
+++ b/erpnext/templates/pages/wishlist.py
@@ -14,6 +14,7 @@
items = set_stock_price_details(items, settings, selling_price_list)
+ context.body_class = "product-page"
context.items = items
context.settings = settings
context.no_cache = 1