eruth Posted December 7, 2003 Posted December 7, 2003 Let's say I have the products: Apple Bread Cheese Doughnut but I want the products to appear as: Doughnut Bread Apple Cheese How can I arrange the order of the products so that it's not alphabetical? My only solution thus far, which looks tacky, is to have: A1 Doughnut A2 Bread A3 Apple A4 Cheese But that prefix looks ridiculous. Please, any response any one can give me will be greatly appreciated.
fiat707 Posted December 8, 2003 Posted December 8, 2003 Hey, Erich. I have the same need as you do. I was adding all products in an order I want to display the products, but it came up with the alphabetical order as you mentioned. I checked the product ID numbers and found the id numbers followed in the order I added the products. So the idea is to set it to display products in the order of product id#. But, I don't know how and where to set it up. Hope there are other people here can help on this. KF
fiat707 Posted December 8, 2003 Posted December 8, 2003 Hey, I got the solution for this one! If you can set the order of your product_id (the order you add your products into a category) to be the order you want to display, you can go to catalog/index.php and change the following code: if ($column_list[$i] == 'PRODUCT_LIST_NAME') { $HTTP_GET_VARS['sort'] = $i+1 . 'a'; $listing_sql .= " order by pd.products_name"; break; to: if ($column_list[$i] == 'PRODUCT_LIST_NAME') { $HTTP_GET_VARS['sort'] = $i+1 . 'a'; $listing_sql .= " order by pd.products_id asc"; break; You can get it to display products in order you like. You can also sort in the order of product price if you like. Good luck (I got this help from Matti Ressler of this forum member.)
k_budiarto Posted December 8, 2003 Posted December 8, 2003 yes, fiat707's solution might work just fine for awhile, but it would lead to minor problems in the future. you then would have to deal with MySQL data and change the products_id number everytime you want to change the order of products. my suggestion is to alter the products table and add another column to hold a number for priority/order and then the index.php code to list the products order by that column.
eruth Posted December 8, 2003 Author Posted December 8, 2003 Where do you type in the ID number for a product? Please let me know.
k_budiarto Posted December 8, 2003 Posted December 8, 2003 is that question for me or for fiat707? 'cause i don't understand what you are asking.
eruth Posted December 8, 2003 Author Posted December 8, 2003 I like the idea of creating a second column. I'll pursue that method. Hopefully, I can find a solution on that wiki OsCommerce forum. Something like: Product Item Product Name A101 Apple A150 Bread ...
k_budiarto Posted December 8, 2003 Posted December 8, 2003 oh one more thing, if you pursue my method, you have to add another text box to accomodate the priority number, and add another variable/parameter in your insert into statements and update table statements in your admin/categories.php file. it's messy but it can be done. fiat707's method is actually not any different than mine but i think mine is more scalable and more robust and you don't have to change the priority numbers in phpmyadmin but instead you can edit them directly in osc admin.
brina Posted December 29, 2003 Posted December 29, 2003 Where do you type in the ID number for a product? Please let me know. This part I don't understand.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.