Closed oxcakmak closed 3 years ago
This should work: lib.deleteRows("products", {quantity: 0});
thanks for the answer. I want to do it in the if query in the basket operation I want to do, if it is not 0, it will be decreasing, if 0, it will be deleted.
` $(".minusItem").click(function(e){
e.preventDefault();
lib.update("product",{slug: $(this).attr("slug")},
function(row) { // update function
row.amount-=1;
return row;
xs=1;
}
);
lib.commit();
shortToast("'.$lang['message_cart_minus_product'].'", "'.$lang['label_mt_success'].'", "success");
setInterval(function(){ location.reload(); },1500);
});
`
For example, there is product data (id, image, title, quantity and price).
How can I delete this product when the quantity is 0?