Remove Item
Removes an item from the cart.
POST /ajax/cart/remove
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
itemId | string | Yes | The cart item ID to remove |
Request Body
{
"itemId": "696f6253e57dc27b63649385"
}
JavaScript Example
async function removeFromCart(itemId) {
const res = await fetch('/ajax/cart/remove', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ itemId })
});
return res.json();
}
SDK Alternative
const cart = await qumra.cart.remove('696f6253e57dc27b63649385');
HTML:
<button data-qumra-cart-remove="696f6253e57dc27b63649385">
حذف
</button>
الاستماع للحدث:
qumra.on('cart:removed', (payload) => {
showToast('تم حذف المنتج من السلة');
});