skip to Main Content

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.

3

Answers


  1. Chosen as BEST ANSWER

    For anyone else with this issue, I found that I was looking at the problem in the wrong way. Offering framing on a unique product like a painting is not truly a product variation, but something more akin to a delivery option. As suggested by Lynn Greene here, what I really wanted was an optional extra for the product - a product add-on.

    I found the free version of the plugin "Advanced Product Fields for WooCommerce" did this pretty simply.


  2. Variations in WooCommerce create a product for each variation. They are meant to be used when you have products that come in different varieties (small, medium, large, or blue, red, yellow, etc.)

    The use case you’re describing seems a better fit for a product add-on field. This would allow the customer to check a box or select an option, and pass the value of that option to you in the order details. This lets you have one product listing per painting, but still allows the customer to select a framing option.

    You can do this with a plugin (Product Addons for Woocommerce, Extra Product Options, etc.), or with your own code.

    Login or Signup to reply.
  3. Similar question was asked here:
    Add a custom class to variation options displaying "Out Of Stock" in Woocommerce

    You can use the answer from that thread to add a css class or append extra text to out of stock variations.

    By using the added class you can also hide the items using css.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search