Sell one unique item with Woocommerce?

I would like to sell drawings and paintings using Woocommerce. Woocommerce is expecting that there are more copies of each product, but the problem is there is only one (1) of each drawing/painting.

How can I create in Woocommerce a unique product? So after this product is sold, processed and completed it is shown as ‘sold out’.

Read More

Can this be solved with a piece of code? Or does anyone know about a plugin? I wasn’t able to find anything.

Please help an artist!

Related posts

1 comment

  1. This should be possible with the built-in features of WordPress. In your WooCommerce Settings, in the Inventory tab, enable Stock Management. Then, when you create or edit a product, select the Inventory tab in the Product Data section and enable stock management for that product. You will then be able to set a stock quantity of 1 (and make sure that backorders aren’t allowed).

    Once that 1 item has been sold, WooCommerce will automatically change the status to say ‘Out of stock’ and will not allow that product to be sold again.

    For a situation like this, you may also want to customise the messages displayed to the user to something other than the default ‘Out of stock’/’1 in stock’. To change it to show Sold/Available instead, you can use the woocommerce_stock_html filter. Just add code like the following to your theme’s functions.php file:

    add_filter('woocommerce_stock_html', 'change_stock_message', 10, 2);
    function change_stock_message($message, $stock_status) {
        if ($stock_status == "Out of stock") {
            $message = '<p class="stock out-of-stock">Sold</p>';    
        } else {
            $message = '<p class="stock in-stock">Available</p>';           
        }
        return $message;
    }
    

Comments are closed.