diff --git a/VirtoCommerce.Storefront.Model/Catalog/Specifications/ProductIsAvailableSpecification.cs b/VirtoCommerce.Storefront.Model/Catalog/Specifications/ProductIsAvailableSpecification.cs index 21667c6..3e745b9 100644 --- a/VirtoCommerce.Storefront.Model/Catalog/Specifications/ProductIsAvailableSpecification.cs +++ b/VirtoCommerce.Storefront.Model/Catalog/Specifications/ProductIsAvailableSpecification.cs @@ -18,10 +18,10 @@ public virtual bool IsSatisfiedBy(long requestedQuantity) if (result && _product.TrackInventory) { result = _product.Inventory != null && - _product.AvailableQuantity + - (Convert.ToInt32(_product.Inventory.AllowPreorder) * _product.Inventory.PreorderQuantity) + - (Convert.ToInt32(_product.Inventory.AllowBackorder) * _product.Inventory.BackorderQuantity) - >= requestedQuantity; + _product.AvailableQuantity + + (Convert.ToInt32(_product.Inventory.AllowPreorder) * Convert.ToInt32(_product.Inventory.PreorderQuantity)) + + (Convert.ToInt32(_product.Inventory.AllowBackorder) * Convert.ToInt32(_product.Inventory.BackorderQuantity)) + >= requestedQuantity; } return result; diff --git a/VirtoCommerce.Storefront.Model/Catalog/Specifications/ProductIsInStockSpecification.cs b/VirtoCommerce.Storefront.Model/Catalog/Specifications/ProductIsInStockSpecification.cs index 0790bda..96894c3 100644 --- a/VirtoCommerce.Storefront.Model/Catalog/Specifications/ProductIsInStockSpecification.cs +++ b/VirtoCommerce.Storefront.Model/Catalog/Specifications/ProductIsInStockSpecification.cs @@ -12,8 +12,8 @@ public virtual bool IsSatisfiedBy(Product product) { result = product.Inventory != null && product.AvailableQuantity + - (Convert.ToInt32(product.Inventory.AllowPreorder) * product.Inventory.PreorderQuantity) + - (Convert.ToInt32(product.Inventory.AllowBackorder) * product.Inventory.BackorderQuantity) + (Convert.ToInt32(product.Inventory.AllowPreorder) * Convert.ToInt32(product.Inventory.PreorderQuantity)) + + (Convert.ToInt32(product.Inventory.AllowBackorder) * Convert.ToInt32(product.Inventory.BackorderQuantity)) > 0; } return result;