Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can You Order Products by Price in the 'Whats New' Box?


swiftmed

Recommended Posts

Posted

Hey Guys & Gals,

 

 

I am trying to order the products in my store by price, rather than the random sort that occurs out-of-the-box, i have changed how my products are ordered in the categories by editing the

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

 

but this doesnt change the sort order in the whats-new boxes on the home page, and top level categories.

 

Could anybody tell me how i can order these products by their price too please?

 

Thank you for your time.

 

Andy

Posted
Guys, Cmon, somebody must know how this is done. PLEASE help me???

 

perhaps you are not receiving a response because this is a question that comes up often and has even been addressed recently. did you try searching the forums before posting? when i did, i found the following: http://www.oscommerce.com/forums/index.php?showtopic=308798

 

always use search first. you get your answer within minutes instead of days. :)

Posted
perhaps you are not receiving a response because this is a question that comes up often and has even been addressed recently. did you try searching the forums before posting? when i did, i found the following: http://www.oscommerce.com/forums/index.php?showtopic=308798

 

always use search first. you get your answer within minutes instead of days. :)

 

Hi,

 

Thanks for the reply, but i have already followed the instructions in that thread, made the changes and your right, that changes the listing order to go by price, but it doesnt change the way products are listed in the WHATS_NEW box. Products are still all over the place.

 

you can see what i mean by looking at my site: http://loveandmarriagebridal.co.uk/

 

This is the hard code from index.php

 

	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_PRICE') {
	  $HTTP_GET_VARS['sort'] = $i+1 . 'a';
	  $listing_sql .= " order by pd.products_price";
	  break;

 

Please help with regards to ordering by price in my whats_new box please. my customer really needs a solution for this ASAP.

 

Thanks for your time

Andy

Posted
This Issue has been resolved.

 

Thanks everybody and special thanks to 'spooks'

1054 - Unknown column 'pd.products_price' in 'order clause'

 

select p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join specials s on p.products_id = s.products_id, products_to_categories p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '25' order by pd.products_price limit 0, 20

 

[TEP STOP]

Archived

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

×
×
  • Create New...