Clear cookies to ensure no order referenced. Add any item to the basket. Go to basket and remove item - either by clicking minus sign or "x" delete. Item is removed.
That functionality is fine, but basket still shows sub-total / total rows and more importantly, still has the Continue button which is active. Clicking it takes you to the next page ... and you can continue all the way through the order process.
How can I make TeaCommerce realise that the basket is empty when all products have been removed?
I think the simplest thing would be on your checkout pages to instead of just null checking order, also check to see if you actually have any order lines.
if (order != null && order.OrderLines.Count > 0) {
// Show the checkout page
}
If you want to remove the order if there are no order lines, then you could create an event handler and listen for either the order Updated or OrderLinesRemoved events and if the order has no order lines left then call order.Delete().
Basket does not clear when deleting last item
I have checked this on the demo site - https://demo.teacommerce.net/ - and the same thing happens as on our site.
Clear cookies to ensure no order referenced. Add any item to the basket. Go to basket and remove item - either by clicking minus sign or "x" delete. Item is removed.
That functionality is fine, but basket still shows sub-total / total rows and more importantly, still has the Continue button which is active. Clicking it takes you to the next page ... and you can continue all the way through the order process.
How can I make TeaCommerce realise that the basket is empty when all products have been removed?
Hi Gordon,
I think the simplest thing would be on your checkout pages to instead of just null checking order, also check to see if you actually have any order lines.
If you want to remove the order if there are no order lines, then you could create an event handler and listen for either the order
Updated
orOrderLinesRemoved
events and if the order has no order lines left then callorder.Delete()
.is working on a reply...