Got it working with the following method. There’s probably a better way to do it but this is good enough for it’s purpose.
Added IF
statement for options
if($_POST['date'] === 'HIGH'){
$order="meta_value_num";
$sort="DESC";
}
elseif ($_POST['date'] === 'LOW'){
$order="meta_value_num";
$sort="ASC";
}
elseif ($_POST['date'] === 'ASC'){
$order="date";
$sort="ASC";
}
elseif ($_POST['date'] === 'DESC'){
$order="date";
$sort="DESC";
}
Then inside the $args
$args = array(
'order' => $sort,
'post_type' => 'product',
'meta_key' => 'ek-product-price',
'orderby' => $order,
)
Form
<select id="select1" type="text" name="date">
<option value="ASC" type="hidden">ASC</option>
<option value="DESC" type="hidden">DESC</option>
<option value="HIGH" type="hidden">HIGH</option>
<option value="LOW" type="hidden">LOW</option>
</select>