title: Woocommerce order by custom callback function
body: <p>I added a new sorting option to Woocommerce, which would sort by the lowest price. All my prices are stored in a custom attribute, along with some other serialized data. What I want is to have a callback function which would unserialize this data, check for the lowest price and sort by that price.</p>
  
  <p>Every post I saw about custom ordering options, makes use of the <code>woocommerce_get_catalog_ordering_args</code> filter to add orderby arguments to WP_Query, but I haven't seen any way to sort the results of the returned query via a callback function.</p>
  
  <p>Is there any way to achieve this? I was looking at <code>woocommerce_after_product_ordering</code> based on the name, but couldn't find much info about it. Any help would be much appreciated!</p>
  
  <pre><code>function my_woocommerce_product_sorting($orderby) {
      $orderby['price_asc'] = "Sort by cheapest";
      $orderby['price_desc'] = "Sort by most expensive";
  
      return $orderby;
  }
  add_filter("woocommerce_catalog_orderby", "my_woocommerce_product_sorting", 20);
  </code></pre>