Hi all. I’m trying to change the order of how variant options are shown on a product page. I’m trying to show all ‘in stock’ variants first in the drop down list and all ‘out of stock’ items at the bottom of the drop down list.
Is this possible?
I’m sure it is with a bit of coding but I am struggling to work this one out.
Hello @Nigel_Burke ,
Yes, it seems possible. Try to make the variant option loop conditional
If option variant in stock display stock options and stop after that in other condition if variant options are not in stock.
If it will not work then you can try rearrangement of html with JS data-attributes.
Assign variant options with data attribute e.g. In stock data attribute = 1 and Out of stock data attribute = 2
Thanks for getting back to me so quickly, Guleria. Sounds like it could work like this, thanks. However, my scripting skills are pretty poor to say the least. Is this something I can look for you help with?
Hello Nigel,
Did you find a solution for the query you have mentioned?
Regards,
Ashritha Hegde