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() 



Newer Version Available

This content describes an older version of this product. View Latest

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