Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to order listing by model as default on product_list.php


peterbat

Recommended Posts

by changing your catalog\index.php

 

from this:

if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
	  $HTTP_GET_VARS['sort'] = $i+1 . 'a';
	  $listing_sql .= " order by pd.products_name";
	  break;
	}

to this

if ($column_list[$i] == 'PRODUCT_LIST_MODEL') {
	  $HTTP_GET_VARS['sort'] = $i+1 . 'a';
	  $listing_sql .= " order by p.products_model";
	  break;
	}

Link to comment
Share on other sites

by changing your catalog\index.php

 

from this:

if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
	  $HTTP_GET_VARS['sort'] = $i+1 . 'a';
	  $listing_sql .= " order by pd.products_name";
	  break;
	}

to this

if ($column_list[$i] == 'PRODUCT_LIST_MODEL') {
	  $HTTP_GET_VARS['sort'] = $i+1 . 'a';
	  $listing_sql .= " order by p.products_model";
	  break;
	}

 

Woot saved me searching on how to do it by price. Made the mistake of not catching that d in the from this code and left it in for the to this.

Link to comment
Share on other sites

  • 4 weeks later...

Please note before changing the code, set the "Display Product Model" to "0."

 

When I tried replacing the code I got error mssages. So I set the Display Product Model to 0 then replaced the code and then set Display Product Model to 3 and all worked fine.

 

Tony

 

 

Woot saved me searching on how to do it by price. Made the mistake of not catching that d in the from this code and left it in for the to this.
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...