Advertisement
lorro

WooCommerce - Increase the variations threshold

May 15th, 2020
1,532
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. <?php
  2.   // WooCommerce - Increase the variations threshold (the default is usually 30)
  3.   // Credit: mohsinoffline
  4.   // User kanlailey reported this doesn't work if the WooCommerce Stripe plugin is active
  5.   add_filter( 'woocommerce_ajax_variation_threshold', 'custom_variation_threshold', 10, 2 );
  6.   function custom_variation_threshold( $default, $product ) {
  7.     return 60; // set this number to your maximum number of variations
  8.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement