Shopify SDK for Unity
Classes | Public Member Functions | Public Attributes | Properties | List of all members
Shopify.UIToolkit.CartController Class Reference

Classes

class  CartItemsChangeEvent
 
class  PurchaseFailedEvent
 
class  QuantityChangeEvent
 

Public Member Functions

 CartController (Cart cart)
 
void SetCart (Cart cart)
 
void AddVariant (ProductVariant variant, Product product)
 Adds a variant to the cart More...
 
void UpdateVariant (ProductVariant variant, Product product, long quantity)
 Sets the variant to the specified quantity in the cart. More...
 
void RemoveVariant (ProductVariant variant, Product product)
 Removes a variant from the cart. More...
 
void ClearCart ()
 Clears all items from the cart More...
 
void CanCheckoutWithNativePay (CanCheckoutWithNativePayCallback callback)
 
void StartPurchase (CheckoutMode mode)
 Start a purchase with the current cart. More...
 

Public Attributes

UnityEvent OnPurchaseStarted = new UnityEvent()
 
QuantityChangeEvent OnQuantityChange = new QuantityChangeEvent()
 
CartItemsChangeEvent OnCartItemsChange = new CartItemsChangeEvent()
 
UnityEvent OnPurchaseComplete = new UnityEvent()
 
UnityEvent OnPurchaseCancelled = new UnityEvent()
 
PurchaseFailedEvent OnPurchaseFailed = new PurchaseFailedEvent()
 

Properties

CartLineItems LineItems [get]
 
List< CartItemCartItems [get]
 

Member Function Documentation

◆ AddVariant()

void Shopify.UIToolkit.CartController.AddVariant ( ProductVariant  variant,
Product  product 
)
inline

Adds a variant to the cart

Parameters
variantThe variant to add to the cart
productThe product the variant belongs to

◆ ClearCart()

void Shopify.UIToolkit.CartController.ClearCart ( )
inline

Clears all items from the cart

◆ RemoveVariant()

void Shopify.UIToolkit.CartController.RemoveVariant ( ProductVariant  variant,
Product  product 
)
inline

Removes a variant from the cart.

Parameters
variantThe variant to remove from the cart
productThe product the variant belongs to

◆ StartPurchase()

void Shopify.UIToolkit.CartController.StartPurchase ( CheckoutMode  mode)
inline

Start a purchase with the current cart.

Parameters
modeHow do you want to make the purchase? Native, Web or Auto

◆ UpdateVariant()

void Shopify.UIToolkit.CartController.UpdateVariant ( ProductVariant  variant,
Product  product,
long  quantity 
)
inline

Sets the variant to the specified quantity in the cart.

Parameters
variantThe variant to modify
productThe product the variant belongs to
quantityThe desired quantity

The documentation for this class was generated from the following file: