Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

define my own sort order


Guest

Recommended Posts

I have searched the forum but can t find the answer to my problem. I need to define the sort order of my products in any given category just as sort order is defined for each category.

Does anyone know how this can be done?

I have loked for a contribution for it but none of them say they will allow me to define the sort order of individual products.

 

Thanks

Link to comment
Share on other sites

http://www.oscommerce.com/community/contri...ons,911/page,14

 

You will need to remove any instances of "bimage" and "mimage", but other than that the contribution works like a charm. The "bimage" and "mimage" will be in some of the database select statements where it tells you to replace a section of code in the readme file so just remove those mistakes and you should be all set. An easy way is to use the find feature of notepad and search the readme for those two words and then delete them, hit save, and then install according to readme file. HTH

Link to comment
Share on other sites

Yes, it will work on pre-MS1, MS1, and MS2 although you are correct in that the line numbers will be way off. If you run into a problem let me know and I can look at my files and help you out.

Link to comment
Share on other sites

i made all of the changes and now i get this error when i click on any category with prodycts in it.

Any ideas on how to solve?

(And i did make the changes to the DB.)

 

1109 - Unknown table 'p.products_sort_orderp' in field list

 

select p.products_sort_orderp.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, p.products_sort_order, 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, products_to_categories p2c left join specials s on p.products_id = s.products_id 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 = '26' order by p.products_sort_order limit 0, 20

 

[TEP STOP]

Link to comment
Share on other sites

select p.products_sort_orderp.products_image, pd.products_name

 

You missed the comma in one of your edits between p.products_sort_order and p.products_image it should read:

 

select p.products_sort_order, p.products_image, pd.products_name

Link to comment
Share on other sites

I have absoutleyl no idea where it is...Ive looked everwhere in index.php and can not find it at all. I've done mulitple searches and analyzed each of the results but dont see where this mystery comma should go.

Are you using MS2? Any idea where to look?

Thanks

Link to comment
Share on other sites

You will need to go back through the readme file and check each edit you made. That select statement appears 4 times in admin/categories.php and 4 times in catalog/index.php so it will be in one of those 8 edits. Yes, I have it installed on 4 different stores one pre-MS1, two MS1, and one MS2.

Link to comment
Share on other sites

//PRODUCT_SORT_ORDER ADDED TO THIS SELECT

$product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id, p.products_sort_order  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . $HTTP_GET_VARS['pID'] . "'");

$product = tep_db_fetch_array($product_query);

 

I thought it was in here. i looked at this line:

p.products_sort_order  from " . TABLE_PRODUCTS . " p, "

and moved the "p" to be one space afdter the comma. but it didnt work. This occurs twice on admin/categories.php and i chnage dboth.

Let me know if you have any insight.

 

Thanks

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...