Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

advanced_search / advanced_search_result


keijom

Recommended Posts

In file catalog/advanced_search_result.php at about line 278 you have following:

 

    $order_str = " order by pd.products_name";

 

This short the query results by product name, if no other order option is felected

 

You can change this to order by final_price

Link to comment
Share on other sites

In file catalog/advanced_search_result.php at about line 278 you have following:

 

 $order_str = " order by pd.products_name";

 

This short the query results by product name, if no other order option is felected

 

You can change this to order by final_price

 

// EOF Separate Pricing Per Customer
 if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
   $where_str .= " group by p.products_id, tr.tax_priority";
 }
 if ( (!isset($HTTP_GET_VARS['sort'])) || (!preg_match('/^[1-8][ad]$/', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
   for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
  if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
    $HTTP_GET_VARS['sort'] = $i+1 . 'a';
    $order_str = " order by pd.products_name";
    break;
  }
   }
 } else {
   $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
   $sort_order = substr($HTTP_GET_VARS['sort'], 1);
   switch ($column_list[$sort_col-1]) {
  case 'PRODUCT_LIST_MODEL':
    $order_str = " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;
  case 'PRODUCT_LIST_NAME':
    $order_str = " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
    break;
  case 'PRODUCT_LIST_MANUFACTURER':
    $order_str = " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;
  case 'PRODUCT_LIST_QUANTITY':
    $order_str = " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;
  case 'PRODUCT_LIST_IMAGE':
    $order_str = " order by pd.products_name";
    break;
  case 'PRODUCT_LIST_WEIGHT':
    $order_str = " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;
  case 'PRODUCT_LIST_PRICE':
    $order_str = " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;
   }
 }
 $listing_sql = $select_str . $from_str . $where_str . $order_str;
 require(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
?>

 

 

I tryed change that. Not working.

 

But if I change "m.manufacturers_name" --> works fine. But "final_price" not working, I don`t know why?

 

 

This is result "final_price :lol:

 

Metzeler Sportec M3 180/55 ZR 17 TL (73W) 114.08eur Buy Now

Metzeler Z8 Interact O 180/55 ZR 17 (73W) TL 133.02eur Buy Now

Metzeler Roadtec Z6 180/55 ZR 17 (73W) TL 117.80eur Buy Now

Metzeler Sportec M5 interact 180/55 ZR 17 (73W) TL 145.08eur Buy Now

Michelin Pilot Power 2CT 180/55 ZR 17 (73W) TL Rear 122.76eur Buy Now

Michelin Pilot Road 180/55 ZR 17 (73W) TL Rear 101.68eur Buy Now

Link to comment
Share on other sites

@@keijom

 

That is not very correct, because it does not take care of any special price. The "final_price" is created "by the system", if special price exist, then it's this, else the regular price

Link to comment
Share on other sites

  • 7 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...