CartExtension.CartItemChange

Object that may contain data about a changed CartItem, that can be used to optimize the business logic in custom calculators.

Constructors 

global CartItemChange(OptionalCartItem optionalCartItem) 

Constructor for `CartItemChange’ object to be used only in Apex unit test. All arguments are required.

Parameters 

ParamDescription
OptionalCartItemProvides the changed item

Methods 

global OptionalCartItem getChangedItem() 

Get the changed Cart Item

Returns 

TypeDescription
OptionalCartItemOptionalCartItem

global Boolean isAdded() 

Checks if the Cart Item was added

Returns 

TypeDescription
Booleans Boolean

global Boolean isRemoved() 

Checks if the Cart Item was removed

Returns 

TypeDescription
Booleans Boolean

global Boolean isQuantityIncreased() 

Checks if the Cart Item quantity increased

Returns 

TypeDescription
Booleans Boolean

global Boolean isQuantityDecreased() 

Checks if the Cart Item quantity decreased

Returns 

TypeDescription
Booleans Boolean

Classes 

Builder 

Builds an instance of CartItemChange. This should only be used for Apex unit testing.

Constructors 

global Builder() 


Methods 

global Builder withChangedItem(OptionalCartItem optionalCartItem) 

global Builder withAdded(boolean isAdded) 

global Builder withRemoved(boolean isRemoved) 

global Builder withQuantityIncreased(boolean isQuantityIncreased) 

global Builder withQuantityDecreased(boolean isQuantityDecreased) 

global CartItemChange build() 



Developer Preview

This release is in preview. Features described in this document don't become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can't guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!