My development website has a traffic light graphic system to illustrate stock levels for each item.
In amongst those simple products, I have a few bundle products (more to come in future).
On the product listings (and details) pages, the stock graphic is always showing red, or out of stock – even when every product contained in the bundle is IN stock.
I figure the only way around this is to hide the stock graphic for all bundle products.
Does anyone know how to do this?
How do I perform a test in code to display (or not) the stock graphic based on the products type_id being bundle?
My worry is that this isn’t a great idea due to the added overhead of testing each product before displaying the page??
Any other suggestions are more than welcome!
Cheers!
It turns out this is far simpler than previously thought.
The following code will check if a product is of type “Bundle” and then conditionally show the stock counter.
I hope that helps someone else looking for this!