WooCommerce 30+ Variation Not Working [How-To Fix]

Optimization and flexibility WooCommerce have made this platform more and more popular amongst online store developers. Based on it WordPress, WooCommerce is an ideal module (plugin) for those who want to create an online store from scratch. It has a very good indexing rate (SEO), does not require many system resources on the host servers (if they are configured for WooCommerce) and it is easy to given. In addition, it offers multiple options stock management, produced codesEtc. attributes si variations.

Many would say that WooCommerce is not meant for giant online stores (most likely not), but from experience we can say that it is easy to carry over 10.000 products without putting an extraordinary load on the servers. This depends, of course, on how the host server is configured. We recommend NGINX + PHP-FPM on a server, and SQL on another server.
In WooCommerce there is still a limitation that few people know about. At over a number 30 variations, the selection fields do not count attribute combinations. There is no panic, because if the attribute combination is not managed, the product can not be ordered. But it can be a problem for customers. They will have to guess which combination of attributes is in stock.

How do we make the attributes from WooCommerce to function normally and in over 30 variations

In the seats WooCommerce there is no option to change the variation limit, but we can do this by editing the functions.php file of the theme WordPress on which the online store operates.
Add the following line to "/path/wp-content/themes/wootheme/functions.php".

function custom_wc_ajax_variation_threshold( $qty, $product ) {
return 200;
}
add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 100, 2 );

It is preferable to add the line above to the end of the code lines already existing in the active theme WooCommerce. After saving, you can see that the limit of 30 variations has been changed, and the combinations of attributes work without problems.

Passionate about technology, I enjoy writing on StealthSettings.com since 2006. I have a rich experience in operating systems: macOS, Windows, and Linux, as well as in programming languages and blogging platforms (WordPress) and for online stores (WooCommerce, Magento, PrestaShop).

How to » Curiosity » WooCommerce 30+ Variation Not Working [How-To Fix]
Leave a Comment