45f64bd930
- 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
22 lines
911 B
Python
22 lines
911 B
Python
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
|
# License: GNU General Public License v3. See license.txt
|
|
import frappe
|
|
from erpnext.e_commerce.doctype.item_review.item_review import get_item_reviews
|
|
from erpnext.e_commerce.doctype.website_item.website_item import check_if_user_is_customer
|
|
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
|
|
|
|
if frappe.form_dict and frappe.form_dict.get("web_item"):
|
|
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)
|