resolveCart
Optional<com.broadleafcommerce.cart.client.domain.Cart> resolveCart(javax.servlet.http.HttpServletRequest request)
Resolve the cart for the given request.
First check if there are any overrides for resolving a specific cart. By default, this comes
in the form of a request header.
Next, determine if there is an anonymous cart or a registered customer cart. If both are
found, transfer anonymous cart ownership to the registered customer and that cart is
returned. Then, if either are found, that cart is returned. If neither are found, no cart is
returned.
- Parameters:
request
- The request to use to resolve the cart.
- Returns:
- The cart resolved for the given request.