-
addToFavList(String item)
Adds an item to the favorites list.
Parameters:item
: String, required – The identifier of the item to add.
Future<MocaResult<dynamic>> addToFavList(String item);
-
removeFromFavList(String item)
Removes an item from the favorites list.
Parameters:item
: String, required – The identifier of the item to remove.
Future<MocaResult<void>> removeFromFavList(String item);
-
clearFavList()
Clears all items from the favorites list.Future<MocaResult<void>> clearFavList();
-
addToWishList(String item)
Adds an item to the wish list.
Parameters:item
: String, required – The identifier of the item to add.
Future<MocaResult<void>> addToWishList(String item);
-
removeFromWishList(String item)
Removes an item from the wish list.
Parameters:item
: String, required – The identifier of the item to remove.
Future<MocaResult<void>> removeFromWishList(String item);
-
clearWishList()
Clears all items from the wish list.Future<MocaResult<void>> clearWishList();
-
addToCart(String item, {String? category, required double unitPrice, required String currency, required double quantity})
Adds an item to the shopping cart with details such as price, currency, and quantity.
Parameters:item
: String, required – The identifier of the item.category
: String, optional – The category of the item.unitPrice
: double, required – Price per unit.currency
: String, required – The currency code (e.g., "USD").quantity
: double, required – The quantity of the item.
Future<MocaResult<void>> addToCart(String item, {String? category, required double unitPrice, required String currency, required double quantity});
-
updateCart(String item, double quantity)
Updates the quantity of an existing item in the shopping cart.
Parameters:item
: String, required – The identifier of the item.quantity
: double, required – The updated quantity.
Future<MocaResult<void>> updateCart(String item, double quantity);
-
removeFromCart(String item)
Removes an item from the shopping cart.
Parameters:item
: String, required – The identifier of the item.
Future<MocaResult<void>> removeFromCart(String item);
-
clearCart()
Clears all items from the shopping cart.Future<MocaResult<void>> clearCart();
-
beginCheckout()
Initiates the checkout process.Future<MocaResult<void>> beginCheckout();
-
completeCheckout()
Completes the checkout process.Future<MocaResult<void>> completeCheckout();
-
trackPurchased(String item, {String? category, required double unitPrice, required String currency, required int quantity})
Tracks a purchase event with details including price, currency, and quantity.
Parameters:item
: String, required – The identifier of the purchased item.category
: String, optional – The category of the item.unitPrice
: double, required – Price per unit.currency
: String, required – The currency code.quantity
: int, required – The quantity purchased.
Future<MocaResult<dynamic>> trackPurchased(String item, {String? category, required double unitPrice, required String currency, required int quantity});
-
trackShared(String item)
Tracks an event when an item is shared.
Parameters:item
: String, required – The identifier of the item shared.
Future<MocaResult<dynamic>> trackShared(String item);