grayson - you are a mind reader! I would like to adapt your code such that instead of displaying number of pieces in stock, I'd like to do the following:
1. check if an attribute variant is in stock
2. if it is, then display an image or words stating something like "24hr dispatch" next to the attribute variant
3. if attribute is out of stock, then display something like "2-3 days dispatch" next to the attribute variant
Since my suppliers can get most items to me within two days, I don't want to lose a sale if the customer doesn't mind waiting a few days more. It also gets around the "tell the customer they're out of stock before adding to cart" debate......
This is particularly important for me as I cannot stock all variants of a product but can order and dispatch them quickly should a customer want them.
So, in summary, is it possible to create some code that checks the attribute stock level and displays the appropriate message? To help clarify, here is an example I am trying to replicate.
Final point is that I only expect to have one attribute array (eg size OR colour, not both).
Looking forward to your help ::tup