From 00578ba6329c3f4681b40cb12801bf085d8c2b45 Mon Sep 17 00:00:00 2001
From: Faris Ansari
Date: Thu, 13 Jun 2019 13:30:39 +0530
Subject: [PATCH] fix: Show product page even if cart is not enabled
---
erpnext/shopping_cart/product_info.py | 5 ++++-
erpnext/templates/generators/item/item_details.html | 8 +++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/erpnext/shopping_cart/product_info.py b/erpnext/shopping_cart/product_info.py
index f9a45ce578..d69b5e3a21 100644
--- a/erpnext/shopping_cart/product_info.py
+++ b/erpnext/shopping_cart/product_info.py
@@ -13,8 +13,11 @@ from erpnext.utilities.product import get_price, get_qty_in_stock
def get_product_info_for_website(item_code):
"""get product price / stock info for website"""
- cart_quotation = _get_cart_quotation()
cart_settings = get_shopping_cart_settings()
+ if not cart_settings.enabled:
+ return frappe._dict()
+
+ cart_quotation = _get_cart_quotation()
price = get_price(
item_code,
diff --git a/erpnext/templates/generators/item/item_details.html b/erpnext/templates/generators/item/item_details.html
index 4f8f8c21a5..8e560333ae 100644
--- a/erpnext/templates/generators/item/item_details.html
+++ b/erpnext/templates/generators/item/item_details.html
@@ -9,7 +9,13 @@
- {{ doc.web_long_description or doc.description or _("No description given") | safe }}
+{% if frappe.utils.strip_html(doc.web_long_description) %}
+ {{ doc.web_long_description | safe }}
+{% elif frappe.utils.strip_html(doc.description) %}
+ {{ doc.description | safe }}
+{% else %}
+ {{ _("No description given") }}
+{% endif %}
{% if has_variants %}