marination | c842305 | 2021-04-07 23:49:04 +0530 | [diff] [blame] | 1 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors |
| 2 | # License: GNU General Public License v3. See license.txt |
marination | c842305 | 2021-04-07 23:49:04 +0530 | [diff] [blame] | 3 | import frappe |
| 4 | from erpnext.e_commerce.doctype.item_review.item_review import get_item_reviews |
| 5 | |
| 6 | def get_context(context): |
marination | b29c5d6 | 2021-05-25 01:35:22 +0530 | [diff] [blame] | 7 | context.no_cache = 1 |
marination | c842305 | 2021-04-07 23:49:04 +0530 | [diff] [blame] | 8 | context.full_page = True |
| 9 | context.reviews = None |
marination | b29c5d6 | 2021-05-25 01:35:22 +0530 | [diff] [blame] | 10 | |
marination | c842305 | 2021-04-07 23:49:04 +0530 | [diff] [blame] | 11 | if frappe.form_dict and frappe.form_dict.get("item_code"): |
| 12 | context.item_code = frappe.form_dict.get("item_code") |
| 13 | context.web_item = frappe.db.get_value("Website Item", {"item_code": context.item_code}, "name") |
| 14 | get_item_reviews(context.web_item, 0, 10, context) |