Merge pull request #17942 from netchampfaris/product-page-cart-disabled

fix: Show product page even if cart is not enabled
This commit is contained in:
Suraj Shetty 2019-06-17 12:36:09 +05:30 committed by GitHub
commit 93fc6004ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -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,

View File

@ -9,7 +9,13 @@
</p>
<!-- description -->
<div itemprop="description">
{{ 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 %}
</div>
{% if has_variants %}