Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

sort by model problem


peteravu

Recommended Posts

Posted

In advanced_search_result.php I change line 305 from

        $order_str = ' order by pd.products_name';

to

  $order_str = ' order by p.products_model';

but only the first page is sort by model not page 2-3 etc. how to do so all the pages are sort by model?

Posted

Just above that, change

        if ($column_list[$i] == 'PRODUCT_LIST_NAME') {

to

        if ($column_list[$i] == 'PRODUCT_LIST_MODEL') {

or if you aren't displaying the model, just below that, change

        case 'PRODUCT_LIST_NAME':
         $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
         break;

to

        case 'PRODUCT_LIST_NAME':
         $listing_sql .= "pd.products_model " . ($sort_order == 'd' ? 'desc' : '');
         break;

Hth,

Matt

Always back up before making changes.

  • 2 weeks later...
  • 4 months later...
Posted
Just above that, change
        if ($column_list[$i] == 'PRODUCT_LIST_NAME') {

to

        if ($column_list[$i] == 'PRODUCT_LIST_MODEL') {

or if you aren't displaying the model, just below that, change

        case 'PRODUCT_LIST_NAME':
         $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
         break;

to

        case 'PRODUCT_LIST_NAME':
         $listing_sql .= "pd.products_model " . ($sort_order == 'd' ? 'desc' : '');
         break;

Hth,

Matt

 

 

there is no pd.products_model, use p.products_model

 

case 'PRODUCT_LIST_NAME':

$listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '');

Treasurer MFC

Archived

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

×
×
  • Create New...