Light Mode
Latest
This endpoint fetches the last cart created by the customer. In other words, the cart will be fetched based on the latest products.
Response
Usage
The latest()
method does not receive any parameters. Simply, the developer may call this method and be able to get the last cart created by the customer.
salla.cart.latest().then((response) => {
/* add your code here */
});
Events
This endpoint may trigger two events, the onLatestFetched and onLatestFailed events.
onLatestFetched
This event is triggered when fetching the last cart created by the customer is done without having any errors coming back from the backend.
salla.event.cart.onLatestFetched((response) => {
console.log(response);
});
onLatestFailed
This event is triggered when fetching the last cart created by the customer is not completed and an error has occurred.
salla.event.cart.onLatestFailed((errorMessage) => {
console.log(errorMessage);
});
Last modified: 10 months ago