Light Mode
Delete Image
This endpoint removes an image file attached to an item already added to the cart by the customer.
Payload
Response
Usage
To delete an image file attached to an item already added to the cart, the developer may call the method deleteItem
as follows:
salla.cart.deleteItem({ file_id: 12345} ).then((response) => {
/* add your code here */
});
// TIP: short version
salla.cart.deleteItem(12345).then((response) => {
/* add your code here */
});
Events
This endpoint may trigger two events, the onImageDeleted and onImageNotDeleted events.
onImageDeleted
This event is triggered when removing an image file attached to an item already added to the cart is done without having any errors coming back from the backend.
salla.cart.event.onImageDeleted((response) => {
console.log(response)
});
onImageNotDeleted
This event is triggered when removing an image file attached to an item already added to the cart is not completed and an error has occurred. For example, the id of the image file was not found.
salla.cart.event.onImageNotDeleted((errorMessage) => {
console.log(errorMessage)
});
Last modified: 10 months ago
Payload
Response
Usage
Events
onImageDeleted
onImageNotDeleted