Page 1 of 1

Sorting Products Ascending

Posted: Mon May 08, 2023 1:34 pm
by bestmate
Hi All, please can someone tell me is there is a way in admin to set products to be listed in and ascending manner instead of descending? Any time I add a product, it shows up first when products are listed. I want to reverse this so products are listed by oldest first instead on the last.

I have the product listing addon but I believe this does not have anything to do with the default sorting in phoenix which shows the latest product first.

Thanks in advance for any assistance.

Re: Sorting Products Ascending

Posted: Mon May 08, 2023 1:38 pm
by tessthepup
bestmate wrote: Mon May 08, 2023 1:34 pm Hi All, please can someone tell me is there is a way in admin to set products to be listed in and ascending manner instead of descending? Any time I add a product, it shows up first when products are listed. I want to reverse this so products are listed by oldest first instead on the last.

I have the product listing addon but I believe this does not have anything to do with the default sorting in phoenix which shows the latest product first.

Thanks in advance for any assistance.
@bestmate
Have you changed this in the product listing settings

Sort Option: Latest Added (0=disable; 1=enable)

edit, sorry ignore that it is not what you asked

Re: Sorting Products Ascending

Posted: Mon May 08, 2023 5:17 pm
by bestmate
@tessthepup No worries, thanks.

@burt Please can you help with this? If you could kindly point me to where I can amend the way the results for new products are ordered, I could try change the ordering format for the database query from DESC to ASC which I believe will sort out my issue.

Many thanks.

Re: Sorting Products Ascending

Posted: Mon May 08, 2023 5:22 pm
by tessthepup
@bestmate

I think you need to look in

includes/modules/content/index_products/cm_ip_product_listing.php

at '// We show them all'

I would copy the file and location into your override template first so you do not mess with the core.

Re: Sorting Products Ascending

Posted: Mon May 08, 2023 5:52 pm
by bestmate
tessthepup wrote: Mon May 08, 2023 5:22 pm
includes/modules/content/index_products/cm_ip_product_listing.php

at '// We show them all'

I would copy the file and location into your override template first so you do not mess with the core.

@tessthepup

Thanks for your suggestion. I'm not quite sure what I expected to do as I don't see anything relating to sorting products in that file. Also, not sure what I should be copying to the ovveride template and where to copy to.

The file you mentioned above seems to relate to categories and manufacturers and I see only two instances of "ORDER BY" and they do not relate to new products. I'd thought I could just make a change somewhere from DESC to ASC but it seems that's not the case?

Re: Sorting Products Ascending

Posted: Mon May 08, 2023 7:19 pm
by bestmate
I got this resolves after tinkering around in three files. Everything sorts ascending now with the ?sort=1a appended to the three links in the three files. May not be pretty but I got my solution.