Force select a variation
-
Hi there
How can we make sure that for every variable product a variation is selected (force select variation)?
We are using this code which is working perfectly for the products that are visible BEFORE infinite scrolling / reload. So it looks like this is not compatible with YITH infinite scrolling plugin.add_filter(‘woocommerce_dropdown_variation_attribute_options_args’,’fun_select_default_option’,10,1);
function fun_select_default_option( $args)
{if(count($args['options']) > 0) //Check the count of available options in dropdown $args['selected'] = $args['options'][0]; return $args;
}
Thanks for your help!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Force select a variation’ is closed to new replies.