'If the Woocommerce default variant is out of stock, can another variant be set?

If the Woocommerce Default Variant is out of stock, can another in-stock variant act as the default variant? I always default the 1st variant on my website. If the 1st variant is out of stock and the customer has entered the product page, the selected variant appears with the phrase "out of stock" and this causes confusion.

Can you help with this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source