lorro

WooCommerce - Increase the variations threshold

May 15th, 2020
1,377
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.   }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×