brotherton-erpnext/erpnext/templates/pages/customer_reviews.py
marination 2fec068aff feat: Recommended Items and Item full page refresh
- Added Optional Recommended Items
- Item Full Page minor UI Refresh
- Floating wishlist button in item full page
- Reviews section UI Refresh
2021-11-16 17:02:43 +05:30

17 lines
737 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
def get_context(context):
context.no_cache = 1
context.full_page = True
context.reviews = None
if frappe.form_dict and frappe.form_dict.get("item_code"):
context.item_code = frappe.form_dict.get("item_code")
context.web_item = frappe.db.get_value("Website Item", {"item_code": context.item_code}, "name")
context.user_is_customer = check_if_user_is_customer()
get_item_reviews(context.web_item, 0, 10, context)