Hi @wetvibes,
Thanks for reaching out to Woo Support!
When i go to checkout a product i get an out of stock error even if the product is in stock
I understand you’re experiencing issues with the stock status of your products when one goes to checkout.
It is possible this could be a theme or plugin conflict.
First, please try to deactivate all plugins except WooCommerce to see if there’s a conflict. (Please be sure to create a backup before performing this step).
If the issue resolves, reactivate the plugins one by one until you find the conflicting one.
If none of the above solutions work, please get back to us with your findings after performing the troubleshooting steps.
Happy to help!
Hello, i managed to fix the issue. There was no plugin or theme conflict issues or something related to woocommerce settings. I fixed it by changing in class-wc-cart.php:
if ( apply_filters( ‘woocommerce_cart_item_required_stock_is_not_enough’, $product->get_stock_quantity() < ( $held_stock + $required_stock ), $product, $values ) ) {
TO
if ( apply_filters( ‘woocommerce_cart_item_required_stock_is_not_enough’, $product->get_stock_quantity() > ( $held_stock + $required_stock ), $product, $values ) ) {
Its not the best solution but it fixed my issue.
Hello @wetvibes,
I’m glad you were able to figure it out! :)
Just a quick suggestion before I mark the thread as solved. In WooCommerce, stock can be marked as ‘out of stock’ even if there’s actual stock available. This depends on the value entered in the screenshot below, which you can find at WooCommerce → Products → Inventory.
Link to image: https://d.pr/i/1l69uM
I’ve also noticed that your server is missing some necessary packages. Although these might not be related to the current issue, I suggest contacting your hosting provider to have them installed to prevent any potential problems in the future. :)
SoapClient: ❌
Multibyte String: ❌ Let us know if you have any other questions!
