Skip to content

Instantly share code, notes, and snippets.

@tronsha
Created January 27, 2016 09:44
Show Gist options
  • Save tronsha/0493d4865679488d493d to your computer and use it in GitHub Desktop.
Save tronsha/0493d4865679488d493d to your computer and use it in GitHub Desktop.
woocommerce: fix "out of stock" message, if more than 30 variants are existing.
<?php
function custom_wc_ajax_variation_threshold( $qty, $product ) {
return sizeof( $product->get_children() );
}
add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment