Please consider leaving a donation if you appreciate this information. Lightning network now available
This type of issue is reported quite often. It may be described as a variable product that shouldn’t have all of these variations available, but it does. When unavailable variations are chosen on the front end, a message “Sorry, this product is unavailable. Please choose a different combination.” is presented to the customer which is, of course, quite confusing. The customer surely thinks this is a horrible experience. Why does WooCommerce do this? you might ask.
The fact is, WooCommerce does this to overcome performance issues. Prior to version 2.4 of WooCommerce, a product with a large number of variations always did ALL the database queries for the variations so that only available variations would be available on the front end. All of those database queries are very resource intensive. Even the best available hosting plans would become bogged down by the load of thousands of variations (this is more common than you might think). I made this screen cast to provide a visual reference to what those queries are building for variation data (30 variations in this case).
WooCommerce 2.4 included a lot of work on improving the variations interface and you can read all about that on the official WooCommerce development blog. Do note, that at that time, the variation threshold was 20. It has since increased 50% to 30.
So, with all of that in mind and knowing that displaying more than 30 available variations can result in unsolvable problems, there is a filter available and when I looked here, I found 21 different examples of how this filter can be implemented.
Please consider leaving a donation if you appreciate this information. Lightning network now available
Leave a Reply
You must be registered and logged in to post a comment.