Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

in admin how to sort categories by product name


Recommended Posts

I resenly update my side (admin side) so that I could search by product number. I like the new search works great. But now my products are listed ramdily and I would like to get them to sort ascending again. Where do I need to go and what do I need to look for to change?


Link to comment
Share on other sites

Hi - guessing that you've added in a database query that searched on products_id then find that query and see if it has an ORDER BY tacked onto the end - so you'll see something like tep_db_query("SELECT yadda yadda FROM products p, products_description pd WHERE yadda yadda") that may or may not have "ORDER BY p.products_id" or similar on the end


if it hasn't then add ORDER BY pd.products_name ASC into the end query


if it has then just add in , pd.products_name ASC after whatever is there first (note the comma)


if the orignal query uses a different label other than 'pd' for the products_description table then be careful to substitute that in the above

Link to comment
Share on other sites

OK found it.



lines 1166 and 1168

at the end of each line was: order by p.products_date_added desc

changed to: order by pd.products_name


That put it in name order. It would be nice if there was a way to add to the top bar, a sort by model or date or name to this page. I just don't know about code to added it.

Link to comment
Share on other sites


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

  • Create New...