riccardino Posted May 27, 2004 Posted May 27, 2004 Hi... :P Default OSC configuration have sort products by name. ;) Where/How I can chage it if I want sort my products by "model" :) Regards. :rolleyes:
gazzzzzza Posted May 28, 2004 Posted May 28, 2004 search for $listing_sql .= " order by pd.products_name"; in your index page i believe this is the default order statement change it to $listing_sql .= " order by p.products_model, pd.products_name"; this should order by model then name or for just model try $listing_sql .= " order by p.products_model"; :D always here to offer some useless advice....
str33k Posted May 29, 2004 Posted May 29, 2004 if its okay id like to tag along and add a question i basicly have his same problem with Available Options. id like it to sort by like id number or some thing so i can have it in the order i want it to have the drop downs in. for example i have say memory processors and hard drives as options. id like for processors to be the first option they can select atm it aranges them alphabetically. any ideas?
bglkk Posted May 29, 2004 Posted May 29, 2004 attrib_sort_v1.0 http://www.oscommerce.com/community/contributions,1822 "Buy the ticket, take the ride..." -HST
241 Posted May 30, 2004 Posted May 30, 2004 no problem and if an occasssion requires it you can add limits to the number of items shown on a given page. No longer giving free advice. Please place deposit in meter slot provided. Individual: [=] SME: [==] Corporation: [===] If deposit does not fit one of the slots provided then you are asking too much! Is your Osc dated try Phoenix raising oscommerce from the ashes.
riccardino Posted May 30, 2004 Author Posted May 30, 2004 GREAT!!! $listing_sql .= " order by p.products_model"; This is perfect!!!
str33k Posted May 31, 2004 Posted May 31, 2004 alright the contrib link u linked me to wasnt really what i was looking for yet i would be lookign for it down the road so thanks i just in stalled it. but im looking to sort the option name not the option value in the drop down i want to beable to have what it says for name sorted not the order of the drop down. any idea on that one?
gazzzzzza Posted June 1, 2004 Posted June 1, 2004 $listing_sql .= " order by p.price"; always here to offer some useless advice....
Guest Posted June 2, 2004 Posted June 2, 2004 got it working. Just for the record incase someone reads this, its actually: p.products_price Thanks
Guest Posted June 2, 2004 Posted June 2, 2004 There are two places in index.php that have to be changed in order for the second and subsequent pages to be sorted by model. If you only change the first of these, the first page gets sorted by model, but other pages don't. I changed these two sections and it works fine: change pd.products_name to p.products_model in if ($column_list[$i] == 'PRODUCT_LIST_NAME') { $HTTP_GET_VARS['sort'] = $i+1 . 'a'; $listing_sql .= " order by p.products_model"; break; and change pd.products_name to p.products_model in case 'PRODUCT_LIST_NAME': $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '');
Recommended Posts
Archived
This topic is now archived and is closed to further replies.