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; diff --git a/VirtoCommerce.Storefront/Filters/AngularAntiforgeryCookieResultFilter.cs b/VirtoCommerce.Storefront/Filters/AngularAntiforgeryCookieResultFilter.cs index 0d68230..7762ba3 100644 --- a/VirtoCommerce.Storefront/Filters/AngularAntiforgeryCookieResultFilter.cs +++ b/VirtoCommerce.Storefront/Filters/AngularAntiforgeryCookieResultFilter.cs @@ -30,7 +30,7 @@ public override void OnResultExecuting(ResultExecutingContext context) if (context.Result is ViewResult viewResult && statusCodeReExecuteFeature == null) { var tokens = antiforgery.GetAndStoreTokens(context.HttpContext); - context.HttpContext.Response.Cookies.Append("XSRF-TOKEN", tokens.RequestToken, new CookieOptions() { HttpOnly = false, IsEssential = true }); + context.HttpContext.Response.Cookies.Append("XSRF-TOKEN", tokens.RequestToken, new CookieOptions() { HttpOnly = false, IsEssential = true, SameSite = SameSiteMode.Lax }); } }