Error with several same components when not enough stock
-
Hi there!
My website threw a critical error, and I narrowed it down to the following: There were too many components selected that were not in stock that many times.
The SITUATION:
1) Unpurchasable products are not shown.
2) Same products for the components are allowed.
3) Components are taken from a category.
4) The default option is not always in stock.The PROBLEM:
The problem now is that, for 7 out of 13 components, it shows the same product (probably the top in the Category, since the Default Option is out of stock). However, when there are not 7 in stock of that particular product, WooCommerce throws a critical error the moment you want to add this composite to the cart.The WORKAROUND for now:
I have disallowed same products for components. Customers now get a warning that they need to select 12 different components and until then the Add to Cart button is greyed out.Desired SOLUTIONS for the workaround:
1) When the Default Option is out of stock for more than 1 component, it should show different new default options so that the composite does not look like it has 7 times the same component. Just take the next-in-line from the category, or something like that?
2) When there are, let’s say, 3 of a product in stock, it should not allow more than 3 components to have that product selected. I know that this means that the plugin needs to do constant stock re-checking and this is probably bad for server performance. Is there any other solution?Many thanks for your assistance. Please let me know if I need to elaborate a bit more, or better!
The topic ‘Error with several same components when not enough stock’ is closed to new replies.