jeudi 19 juillet 2018

How to add "out of stock" in the dropdown selector? [duplicate]

This question already has an answer here:

Tell me how to add the inscription "Out of Stock" when choosing the size of the product?

In the drop-down list need to show all sizes of clothes. If the size is not available, then we write "Out of Stock". If the size is available, then choose size of clothes.

Here is an example

I put the code that LoicTheAztec offers

How to add variation stock status to Woocommerce product variation dropdown

When editing the product I put all the sizes, two "in stock", the rest are "out of stock".

At me at all sizes of clothes there was an inscription "Out of Stock", though the attribute "size" only one in the dropdown list.

How can this be remedied?

EDIT:

The Answer made by LoicTheAztec has been updated and works as intended.




Aucun commentaire:

Enregistrer un commentaire