Hide variations that don't match Woocommerce

随声附和 提交于 2019-12-01 18:55:01

问题


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:


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 );


来源:https://stackoverflow.com/questions/37186931/hide-variations-that-dont-match-woocommerce

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!