From 706eae7cacc0fb0f7bd922e69c618acc2047200d Mon Sep 17 00:00:00 2001 From: prssanna Date: Wed, 20 Jan 2021 17:47:25 +0530 Subject: [PATCH] fix: product page fixes --- erpnext/templates/generators/item/item.html | 3 + .../generators/item/item_add_to_cart.html | 9 ++- .../generators/item/item_configure.html | 4 +- .../generators/item/item_configure.js | 67 +++++++++++-------- .../generators/item/item_details.html | 5 +- 5 files changed, 52 insertions(+), 36 deletions(-) diff --git a/erpnext/templates/generators/item/item.html b/erpnext/templates/generators/item/item.html index 889908031e..135982d709 100644 --- a/erpnext/templates/generators/item/item.html +++ b/erpnext/templates/generators/item/item.html @@ -3,6 +3,9 @@ {% block title %} {{ title }} {% endblock %} {% block breadcrumbs %} +
+ {% include "templates/includes/breadcrumbs.html" %} +
{% endblock %} {% block page_content %} diff --git a/erpnext/templates/generators/item/item_add_to_cart.html b/erpnext/templates/generators/item/item_add_to_cart.html index 3210e2497f..f5adbf01e3 100644 --- a/erpnext/templates/generators/item/item_add_to_cart.html +++ b/erpnext/templates/generators/item/item_add_to_cart.html @@ -30,7 +30,7 @@ {% endif %} {% endif %} -
+
{% if product_info.price and (cart_settings.allow_items_not_in_stock or product_info.in_stock) %} {% endif %} diff --git a/erpnext/templates/generators/item/item_configure.html b/erpnext/templates/generators/item/item_configure.html index 73f9ec99b3..b61ac73072 100644 --- a/erpnext/templates/generators/item/item_configure.html +++ b/erpnext/templates/generators/item/item_configure.html @@ -1,9 +1,9 @@ {% if shopping_cart and shopping_cart.cart_settings.enabled %} {% set cart_settings = shopping_cart.cart_settings %} -
+
{% if cart_settings.enable_variants | int %} - + ` : ''; const items_found = filtered_items_count === 1 ? __('{0} item found.', [filtered_items_count]) : __('{0} items found.', [filtered_items_count]); - const item_found_status = ` - ` + : ``; return ` - ${item_add_to_cart} ${item_found_status} + ${item_add_to_cart} `; } @@ -254,8 +265,8 @@ class ItemConfigure { } append_status_area() { - this.dialog.$status_area = $('
'); - this.dialog.$wrapper.find('.modal-body').prepend(this.dialog.$status_area); + this.dialog.$status_area = $('
'); + this.dialog.$wrapper.find('.modal-body').append(this.dialog.$status_area); this.dialog.$wrapper.on('click', '[data-action]', (e) => { e.preventDefault(); const $target = $(e.currentTarget); @@ -263,7 +274,7 @@ class ItemConfigure { const method = this[action]; method.call(this, e); }); - this.dialog.$body.css({ maxHeight: '75vh', overflow: 'auto', overflowX: 'hidden' }); + this.dialog.$wrapper.addClass('item-configurator-dialog'); } get_next_attribute_and_values(selected_attributes) { diff --git a/erpnext/templates/generators/item/item_details.html b/erpnext/templates/generators/item/item_details.html index 6a85ca50e6..3b77585827 100644 --- a/erpnext/templates/generators/item/item_details.html +++ b/erpnext/templates/generators/item/item_details.html @@ -1,8 +1,5 @@ -
+
-
- {% include "templates/includes/breadcrumbs.html" %} -

{{ item_name }}