Advertisement
BakerMan

Sort Tickets in Price Ascending Order - WooTickets 1.0.1 alt

Mar 19th, 2013
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  1. // Sort tickets by price
  2. if (!function_exists('custom_wooticket_pricesort')) {
  3.     function custom_wooticket_pricesort($p, $q) {
  4.         if ($p->price < $q->price) return -1;
  5.         if ($p->price > $q->price) return 1;
  6.         return 0;
  7.     }
  8. }
  9.  
  10. // Let's order the tickets in ascending order by price
  11. usort($tickets, 'custom_wooticket_pricesort');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement