Replace
$args = array(
'post_type' => array('product', 'product_variation'),
'post_status' => 'publish',
'posts_per_page' => get_option('posts_per_page'),
'paged' => $paged,
'tax_query' => $tax_query,
'orderby' => 'price',
'order' => 'asc',
);
New code
$orderby = $_GET['orderby'] ?? '';
$args = array(
'post_type' => array('product', 'product_variation'),
'post_status' => 'publish',
'posts_per_page' => get_option('posts_per_page'),
'paged' => $paged,
'tax_query' => $tax_query
);
if ($orderby == 'price') {
$args['orderby'] = 'meta_value_num';
$args['meta_key'] = '_price';
$args['order'] = 'asc';
} elseif ($orderby == 'price-desc'){
$args['orderby'] = 'meta_value_num';
$args['meta_key'] = '_price';
$args['order'] = 'desc';
} elseif ($orderby == 'menu_order') {
// sort menu order
} elseif ($orderby == 'popularity') {
// sort popularity
} elseif ($orderby == 'rating') {
// sort rating
} elseif ($orderby == 'date') {
// sort date
}