Hi guys,
We have a requirement to add some text to the cart page, based on the stock level of each item in the cart. If any items are out of stock at the point of checkout we want to display a warning to the customer that their order won't ship today.
So far, in the template itself I've managed to code up a solution which powers that at page load, so it interrogates the products variable and if any of the stock levels are zero it displays the text. So far so good.
Where I'm a little stumped is how to hide it, if the product that has no stock, is then deleted from the cart.
Not sure if I should add code to hide the div in cart-summary.js or if there's a more elegant way to achieve the entire solution.
Thanks in advance for any advice offered.