Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sorting products by model


Guest

Recommended Posts

Posted

Hi, I am VERY new to osC so bear with me. When the products are displayed for the customer, I know you can choose to show or not show the model numer/name, whatever. Is there a way to sort the products by model # and not show the model # on the page? Please tell me if I am in the wrong section. Thank you.

Posted

Look for this line of code in index.php:

$listing_sql .= " order by pd.products_name";

and change it to:

$listing_sql .= " order by p.products_model";

also if you take out the model from showing in the display, then the query to get the products_model will be taken out so replace this line:

$select_column_list = '';

with this one:

$select_column_list = 'p.products_model';

 

Ryan

If I was crafty, this would be a funny signature.

Posted

hey ryan, i really appreciate it. I'll try to figure out how to get all that working. thx again!

Posted

i ran into a problem....

 

i replaced what you said and i got this:

 

 

-------------

 

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

 

select p.products_modelp.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, 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 = '504' order by p.products_model limit 0, 20

 

[TEP STOP]

Posted

ok, easy fix, just change

$select_column_list = 'p.products_model';

with

$select_column_list = 'p.products_model, ';

Notice the comma and space after the model.

 

Ryan

If I was crafty, this would be a funny signature.

Posted

thanks a lot ryan, im gonna try that and see what happens! B)

Posted

worked, thanks again man..... it seems minor, but i needed this really bad for the site!!!

Archived

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

×
×
  • Create New...