elixir Posted November 26, 2003 Share Posted November 26, 2003 I need help getting the products in a catagory NOT to be displayed alphabetically what page to I edit.. what do I do.. need help. I do. yes. remember I don't want to have my products desplayed aplhabetically I do want them to be displayed as of last date added to the database. Link to comment Share on other sites More sharing options...
wizardsandwars Posted November 26, 2003 Share Posted November 26, 2003 You need to alter your order by clause. product_listing.php ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help. Link to comment Share on other sites More sharing options...
elixir Posted November 26, 2003 Author Share Posted November 26, 2003 order by "clause" ???? me code hacker.. me not programmer.. please do explain. as if you were speaking to that of an idiot. Link to comment Share on other sites More sharing options...
elixir Posted November 26, 2003 Author Share Posted November 26, 2003 where is this "product_listing.php " file.. I find product_info.php.. in both the main directory as well as the includes / language / english directory.. but I don't see a product_listing.php. Link to comment Share on other sites More sharing options...
wizardsandwars Posted November 26, 2003 Share Posted November 26, 2003 Well, there is SQL embedded into the PHP that queries the database and returns the products to an array. This SQL also ORDERS the products according to the field specified. You have to change the field specified from the name of the product to the date the product was entered. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help. Link to comment Share on other sites More sharing options...
elixir Posted November 26, 2003 Author Share Posted November 26, 2003 ok.. so how do I do that? Link to comment Share on other sites More sharing options...
elixir Posted November 26, 2003 Author Share Posted November 26, 2003 ok so I'm in my SQL admin area.. which file.. and what should I change in the tables there? Link to comment Share on other sites More sharing options...
wizardsandwars Posted November 26, 2003 Share Posted November 26, 2003 No, the SQL that you need to change is embedded in PHP. I believe it's in the product_listing.php file. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help. Link to comment Share on other sites More sharing options...
ihsv Posted November 27, 2003 Share Posted November 27, 2003 I am having a similar problem, and I do not see a product_listing.php file either. I was able to order my products by model number by changing the catalog/default.php "order by" clause around line 379, but I must have changed too much (and didn't back it up, of course, because I KNEW what I was doing), and I lost my item display. If you can help me by giving me back the lines of code around that area, maybe we can work through this together before my husband comes home and finds out what I did to his site? Thanks! --David's gal Link to comment Share on other sites More sharing options...
wizardsandwars Posted November 27, 2003 Share Posted November 27, 2003 Well, that's a pretty important lesson you've learned there. Perhaps you should download the whole package again, and ifnd the original code you're looking for. Best of luck. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help. Link to comment Share on other sites More sharing options...
ihsv Posted November 27, 2003 Share Posted November 27, 2003 Lesson learned, but I did manage to fix it and now my products do display by item number. My apologies to elixir, though, as I don't think what I was doing will help him after all. Link to comment Share on other sites More sharing options...
Guest Posted November 27, 2003 Share Posted November 27, 2003 It's includes/modules/product_listing.php. Note: it is called from index.php (default.php in older versions). The code that you want to change is in index.php around lines 191-8: 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)) ) { $listing_sql .= " order by p.products_date_added"; } Hth, Matt Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.