Added a new product option "Disable own stock" (closes #564)

This commit is contained in:
Bernd Bestel
2022-04-01 18:49:17 +02:00
parent b53d1a076f
commit ccc59dfc8b
10 changed files with 132 additions and 19 deletions

View File

@@ -110,7 +110,16 @@ Grocy.Components.ProductCard.Refresh = function(productId)
$("#productcard-product-picture").addClass("d-none");
}
$("#productcard-product-stock-amount-wrapper").removeClass("d-none");
$("#productcard-aggregated-amounts").addClass("pl-2");
if (productDetails.product.no_own_stock == 1)
{
$("#productcard-product-stock-amount-wrapper").addClass("d-none");
$("#productcard-aggregated-amounts").removeClass("pl-2");
}
RefreshContextualTimeago(".productcard");
RefreshLocaleNumberDisplay(".productcard");
},
function(xhr)
{