My site sells paintings, with the option of being framed or unframed. The obvious way to do that seemed to be as product variations. But it's an unusual case, because of course the painting is unique and when either variation is sold the product should be out of stock.
I have the basics of that working now; the product will become unavailable once either variation is sold. But unfortunately the option dropdown still displays, only showing "Out of Stock" after the visitor selects one or other variation. Which seems likely to annoy them.
So what I'm trying to do is hide this options menu and replace it with the standard "Out of Stock" message when the product [or either of its two variations] has been sold. But to my surprise I can't find anyone else who has had this problem, and writing such a function is beyond my own knowledge of PHP and WordPress.
question from:
https://stackoverflow.com/questions/65853343/can-i-hide-the-woocommerce-product-variations-menu-when-the-product-is-sold-out 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…