Closed vkrashenko closed 6 years ago
if (if (product.Variations != null && product.Variations.Any())
{
result.Buyable = product.Variations.Any(v => v.IsBuyable);
}
else
{
result.Buyable = product.IsBuyable;
}
How to test: make all variations and product unavailable. Then make one variation available. Product must be available on storefront.
add in productsAvailablityService two extra methods "isInStock" and "isBuyable". If product quantity = 0 but product can be purchased we can see "sold out". If product can`t be purchased we can see "unavailable".