*

umimo

  • ***
  • 88 posts
Sort function not working
« on: June 21, 2022, 04:06:37 PM »


// SIMPLE SEARCH SORT
function bet_simple_sort() {
  $type = Params::getParam('sOrder');           // date - price
  $order = Params::getParam('iOrderType');      // asc - desc

  $orders = osc_list_orders();

  //$html  = '<input type="hidden" name="sOrder" id="sOrder" val="' . $type . '"/>';
  //$html  = '<input type="hidden" name="iOrderType" id="iOrderType" val="' . $order . '"/>';

  $html  = '<select class="orderSelect" id="orderSelect" name="orderSelect">';
 
  foreach($orders as $label => $spec) {
    $selected = '';
    if( $spec['sOrder'] == $type && $spec['iOrderType'] == $order ) {
      $selected = ' selected="selected"';
    }
    $html .= '<option' . $selected . ' data-type="' . $spec['sOrder'] . '" data-order="' . $spec['iOrderType'] . '">' . $label . '</option>';
  }

  $html .= '</select>';
  return $html;
}

Not working

*

MB Themes

Re: Sort function not working
« Reply #1 on: June 30, 2022, 09:23:18 AM »
@umimo
It is possible, sorting is tuff to do in one box, as osclass expects 2 inputs for that.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots