var anonymousPermissed = _orderSettings.AnonymousCheckoutAllowed
&& _customerSettings.UserRegistrationType == UserRegistrationType.Disabled;
if (anonymousPermissed || !await _customerService.IsGuestAsync(customer))
return RedirectToRoute("Checkout");
var cartProductIds = cart.Select(ci => ci.ProductId).ToArray();
var downloadableProductsRequireRegistration =
_customerSettings.RequireRegistrationForDownloadableProducts && await _productService.HasAnyDownloadableProductAsync(cartProductIds);
if (!_orderSettings.AnonymousCheckoutAllowed || downloadableProductsRequireRegistration)
{
//verify user identity (it may be facebook login page, or google, or local)
return Challenge();
}
My question in here is, why is there the negation sign ! in the conditions to check if the current customer is a guest and to check if the AnonymousCheckoutAllowed option is true? Because if the result is false, for example, If my user is not a guest, here, in the condition, the code is going to return true meaning that I am a guess. So what's the purpose of that code in the conditions?