Hide variations that don't match Woocommerce

2019-02-24 09:50发布

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/ (Apologies for the slow load time) I want to choose a selection from "Width" which should then refresh "Depth" showing only the depths available that match with that width.

Is this possible?

Thanks!

1条回答
Rolldiameter
2楼-- · 2019-02-24 10:39

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 );
查看更多
登录 后发表回答