Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide variations that don't match Woocommerce

So I'm currently working on a Woocommerce store that has lots of variations.

What I'm basically looking for is for the next variation to refresh based on what was chosen on the variation chosen before that.

For example, if you go on http://freelance.tstwebdesign.co.uk/platino/product/plain-platinum-court/, I want to choose a selection from "Width" which should then refresh "Depth" showing only the depths available that match with that width.

How can this be done?

like image 852
user3181828 Avatar asked Nov 08 '22 15:11

user3181828


1 Answers

It's default function for not many variations. For many variations you can do it with function

    // Woo Commerce – Make Variations only appear when available
function custom_wc_ajax_variation_threshold( $qty, $product ) {
return 500;
}

add_filter( ‘woocommerce_ajax_variation_threshold’, ‘custom_wc_ajax_variation_threshold’, 10, 2 );
like image 182
user7867 Avatar answered Nov 15 '22 10:11

user7867