mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 03:09:09 +00:00
feat: Allow items not in stock to be added in cart
This commit is contained in:
@@ -14,7 +14,9 @@ frappe.ready(function() {
|
||||
callback: function(r) {
|
||||
if(r.message) {
|
||||
if(r.message.cart_settings.enabled) {
|
||||
$(".item-cart, .item-price, .item-stock").toggleClass("hide", (!!!r.message.product_info.price || !!!r.message.product_info.in_stock));
|
||||
let hide_add_to_cart = !r.message.product_info.price
|
||||
|| (!r.message.product_info.in_stock && !r.message.cart_settings.allow_items_not_in_stock);
|
||||
$(".item-cart, .item-price, .item-stock").toggleClass('hide', hide_add_to_cart);
|
||||
}
|
||||
if(r.message.cart_settings.show_price) {
|
||||
$(".item-price").toggleClass("hide", false);
|
||||
|
||||
Reference in New Issue
Block a user