Is there a way to manually set a product in Woocommerce to an On Hold status? It would still be displayed on the shop page, but would be marked on hold, and no one would be able to purchase it.
There are instances where someone will call the shop and want to purchase an item, and I just want to place it on hold till they come in and pay for it in person. But I don’t necessary want to remove it from the store page yet, or have other folks think its totally sold. I would like it to be marked as On Hold, and disable the ability for others to purchase it.
I was hoping there was an out of the box way to do this with WooCommerce, but I don’t seem to see one. I have coding ability, so I’m open to writing something custom depending on the complexity.
I understand that you would like to manually set a product to “On Hold” status while having this still display on the shop page but prevent other customers from buying it while in this status, is this correct?
Since this is not a built-in feature of WooCommerce core, it would require custom code or a plugin to achieve.
Kindly note that customization is typically outside the scope of support we are able to provide, however, if you would like to achieve this, you can try adding the following code snippets and see if it works for you.
First, use the below code snippet to add a new custom stock status:
Once this code is added, if a customer tries to add an item with the “On Hold” stock status to their cart, they will be met with the following message:
You need to add the code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme.
Sorry one more question, let me know if I should open a new issue. Your code above worked great in my custom plugin
So now what if I want to add a badge that is a div that says On Hold to each applicable product on the main /shop page? Do I need to edit a template file, if so, which one? Or can that be done in a filter somehow in my custom plugin?
This code will add an “On Hold” badge to the title of each product on the main /shop page if the product has the stock status of “On Hold”. You can modify the CSS class and styling of the badge to fit your design
Here is the outcome on my staging site, after adding both of the above: