Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Products displayed by price ascending OS 2.3.3


themuir

Recommended Posts

Posted

Hi guys, I posted this over year ago but still haven't found a solution. 

 

Hopefully someone will pick up on this.

 

Currently when I add products to the website they are being displayed in alphabetical order across the website.

 

I really want this to be in price order by default. so £1, £3, £5 sort of thing. I'm not fussed about giving people the option of changing this themselves.

 

I have read you can change the index page but only on version 2.2 which will allow for this. The 2.3 version has a different index.

 

Does anyone know of anything I can change please? Where the file is located?

 

Thanks in advance.

 

Tom.

Posted

@@themuir

 

in "catalog\advanced_search_result.php" around lines 275 to 281 change:

    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;
      }
    }

to:

    for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
      if ($column_list[$i] == 'PRODUCT_LIST_PRICE') {
        $HTTP_GET_VARS['sort'] = $i+1 . 'a';
        $order_str = " order by final_price";
        break;
      }
    }

then in "catalog\index.php" around lines 159 to 165 change:

      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:

      for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
        if ($column_list[$i] == 'PRODUCT_LIST_PRICE') {
          $HTTP_GET_VARS['sort'] = $i+1 . 'a';
          $listing_sql .= " order by final_price ";
          break;
        }
      }

My Add-ons
Advanced Cache Control Tool for osCommerce 2.3.x (non-bootstrap) Download Support
Ajax Product Listing for osC 2.3.4 (bootstrap) Download Support
Category New Products Carousel for osC 2.3.4 (bootstrap) Download Support
Category Popular Products Carousel for osC 2.3.4 (bootstrap) Download Support
Customer Testimonials for osCommerce 2.3.4 (bootstrap and non-bootstrap) Download Support
Front Page New Products Carousel for osC 2.3.4 (bootstrap) Download Support

Index Nested - Product Listing for osC 2.3.4 (bootstrapDownload Support
Match Categories in Search Results for osCommerce versions 2.3.x (non-bootstrap) Download Support
Modular Category Page for osC 2.3.4 (bootstrap)
Download Support

NEW Australia Post Shipping Modules for osCommerce 2.3.x (non-bootstrap) Download Support
NEW Equal Height Module for osC 2.3.4 (bootstrapDownload Support
Products Low Stock Report for osC 2.3.x (bootstrap and non-bootstrap) Download Support
Twitter Typeahead Autocomplete Search for osCommerce 2.3.4 (bootstrap and non-bootstrap)
Download Support

Upcoming Products Modules for osC 2.3.4 (bootstrap) Download Support

 
Assisted Add-ons
Scroll Boxes for osCommerce 2.3.x (bootstrap and non-bootstrap) Download Support
 
Bootstrap Add-ons created by other members
osCommerce Bootstrap Addons and Code

Archived

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

×
×
  • Create New...