From 0702fbd20665eebbbf8f4c7e82f2295c88289a6c Mon Sep 17 00:00:00 2001 From: marination Date: Thu, 6 Aug 2020 18:22:28 +0530 Subject: [PATCH] fix: Show Add to Cart Button anyway - add to cart wasnt visible if show price is disabled in shopping cart settings (product_info = null), creating confusion --- .../templates/generators/item/item_configure.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/erpnext/templates/generators/item/item_configure.js b/erpnext/templates/generators/item/item_configure.js index a27c8300dd..5fd901169f 100644 --- a/erpnext/templates/generators/item/item_configure.js +++ b/erpnext/templates/generators/item/item_configure.js @@ -193,24 +193,14 @@ class ItemConfigure { filtered_items_count === 1 ? filtered_items[0] : ''; - // Allow Add to Cart if adding out of stock items enabled in Shopping Cart else check stock. - var in_stock; - var add_to_cart; - var product_action; - if (product_info) { - in_stock = product_info.allow_items_not_in_stock ? 1 : product_info.in_stock; - add_to_cart = `${__('Add to cart')}`; - product_action = in_stock ? add_to_cart : `${__('Not in Stock')}`; - } else { - product_action = ''; - } - const item_add_to_cart = one_item ? ` `: '';