gon11 Posted September 5, 2003 Posted September 5, 2003 Is it possible to show and be able to sort product listing by date? Because is kind of confussing if they all get sorted by manufature or product name since I have about 30 new items every month. I want it to show when it was added and also the choice of sorting by Manufacture, Name or Date. thanks
Guest Posted September 6, 2003 Posted September 6, 2003 Yes,- - you will have to add p.products_date_added to the database queries in index.php - then change the following: 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_date_added"; break; } } If you want "Date Added" to display in the listing, then you will have to add it in the same manner as the other attributes - this involves quite some work on index.php, product_listing.php, english.php and the configuration table in your database
gon11 Posted September 8, 2003 Author Posted September 8, 2003 Ok, I got the part to sort by date, now can somebody show me how I would add the lines neccessary to add the column "Date Added" ?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.