Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product listing - Listing by Model rather than Name?? HELP


fiscus

Recommended Posts

In the product listing the normal method is to list by the Product name - I want to list by the product model.

 

In functions/product_listing.php I have found :

 

      $lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);

 

I played around with the $col+1 (changing the 1 to 2,3, 4 etc moves the little + sign around but doesn't actually sort but wheveter column it has moved to. I am close but just need a little hand.

 

Thanks in advanced.

 

2.2MS2

Link to comment
Share on other sites

Make the change in index.php - change:

 

    if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[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';

         $listing_sql .= " order by pd.products_name";

         break;

       }

     }

 

to:

 

    if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[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';

         $listing_sql .= " order by p.products_model";

         break;

       }

     }

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...