public class CartUpdate extends Update<CartCommands.CartUpdateAction>
Cart
in the backend.Constructor and Description |
---|
CartUpdate() |
Modifier and Type | Method and Description |
---|---|
CartUpdate |
addCustomLineItem(LocalizedString name,
Money money,
java.lang.String slug,
ReferenceId<TaxCategory> taxCategory,
int quantity)
Adds a custom line item in the given quantity to the cart.
|
CartUpdate |
addDiscountCode(java.lang.String discountCode) |
CartUpdate |
addLineItem(int quantity,
java.lang.String productId)
Adds a product master variant in the given quantity to the cart.
|
CartUpdate |
addLineItem(int quantity,
java.lang.String productId,
int variantId)
Adds a product variant in the given quantity to the cart.
|
CartUpdate |
addLineItem(int quantity,
java.lang.String productId,
int variantId,
java.lang.String channelId)
Adds a product variant in the given quantity to the cart with a reference to a Channel.
|
CartUpdate |
addLineItem(int quantity,
java.lang.String productId,
java.lang.String channelId)
Adds a product master variant in the given quantity to the cart with a reference to a Channel.
|
CartUpdate |
decreaseLineItemQuantity(java.lang.String lineItemId,
int quantity)
Decreases the quantity of the given line item.
|
java.util.List<CartCommands.CartUpdateAction> |
getActions() |
CartUpdate |
recalculate()
Updates line item prices and tax rates.
|
CartUpdate |
removeCustomLineItem(java.lang.String lineItemId)
Removes the custom line item from the cart.
|
CartUpdate |
removeDiscountCode(Reference<DiscountCode> discountCode) |
CartUpdate |
removeLineItem(java.lang.String lineItemId)
Removes the line item from the cart.
|
CartUpdate |
setBillingAddress(Address address)
Sets the billing address of the cart.
|
CartUpdate |
setCountry(com.neovisionaries.i18n.CountryCode country)
Sets the country of the cart.
|
CartUpdate |
setCustomerEmail(java.lang.String email)
Sets the customer email in the cart.
|
CartUpdate |
setCustomShippingMethod(java.lang.String shippingMethodName,
ShippingRate shippingRate,
ReferenceId<TaxCategory> taxCategory)
Sets the custom shipping method (not using project shipping methods).
|
CartUpdate |
setLineItemQuantity(java.lang.String lineItemId,
int quantity)
Sets the quantity of the given line item.
|
CartUpdate |
setShippingAddress(Address address)
Sets the shipping address of the cart.
|
CartUpdate |
setShippingMethod(ReferenceId<ShippingMethod> shippingMethod)
Sets the shipping method of the cart.
|
public CartUpdate addLineItem(int quantity, java.lang.String productId, int variantId)
public CartUpdate addLineItem(int quantity, java.lang.String productId, int variantId, java.lang.String channelId)
public CartUpdate addLineItem(int quantity, java.lang.String productId)
public CartUpdate addLineItem(int quantity, java.lang.String productId, java.lang.String channelId)
public CartUpdate removeLineItem(java.lang.String lineItemId)
public CartUpdate addCustomLineItem(LocalizedString name, Money money, java.lang.String slug, ReferenceId<TaxCategory> taxCategory, int quantity)
public CartUpdate removeCustomLineItem(java.lang.String lineItemId)
public CartUpdate decreaseLineItemQuantity(java.lang.String lineItemId, int quantity)
public CartUpdate setLineItemQuantity(java.lang.String lineItemId, int quantity)
public CartUpdate setCustomerEmail(java.lang.String email)
public CartUpdate setShippingAddress(Address address)
public CartUpdate setBillingAddress(Address address)
public CartUpdate setCountry(com.neovisionaries.i18n.CountryCode country)
public CartUpdate setShippingMethod(ReferenceId<ShippingMethod> shippingMethod)
public CartUpdate setCustomShippingMethod(java.lang.String shippingMethodName, ShippingRate shippingRate, ReferenceId<TaxCategory> taxCategory)
public CartUpdate recalculate()
public java.util.List<CartCommands.CartUpdateAction> getActions()
getActions
in class Update<CartCommands.CartUpdateAction>
public CartUpdate addDiscountCode(java.lang.String discountCode)
public CartUpdate removeDiscountCode(Reference<DiscountCode> discountCode)