you make a mistake in the call of add_action
the last parameters must be changed from 1 to 2
add_action('pre_get_posts','shop_filter_cat',10,2);
you make a mistake in the call of add_action
the last parameters must be changed from 1 to 2
add_action('pre_get_posts','shop_filter_cat',10,2);