Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sort order


JJJJ

Recommended Posts

Posted

Does anyone know how to change the order in which my products are displayed in the store.

Posted

You can edit the query to sort products. The only way I know..

Such as on page:

catalog/includes/modules/new_products.php

 

The first query retrieves product values as so -

if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {

$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

 

Towards the end you will find:

order by p.products_date_added desc

 

This sorts products in the new products box by date added to catalog, the desc means in descending order as opposed to asc - ascending order.

 

So it depends on where you want to sort products and what page.. - edit that query..

Lloyd

Archived

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

×
×
  • Create New...