My Problem:
I have been trying to get sort by newest product, to work on my system for days and I cannot get it to work. I am on EE 1.12 and my site doesn’t use flat product data. I have tried a whole bunch of ways to try to get this to work. I always can get the sort option to show up in the sort by drop down, but it seems to order the products by entity_id. This would be fine but it is always ascending, so oldest first, and won't reverse the direction like it will on the other sort by options.
The programming approach:
I have tried to use suggestions from stack overflow and had no luck. After trying their solutions if I put chickens in instead created_at I still get the same result. Note: I was re-indexing after my attempts. My issue seems to be that the sort doesn't have access to the created_at field on the products.
The Database approach:
I reset all my code and tried looking into the database. I found the created_at product attribute in eav_attribute and matched it with the attribute_id in the catalog_eav_attribute table. I tried setting used_for_sort_by to 1 and some other combinations, like set is_visible and is_searchable to 1, while re-indexing after each change and got the same results. Appears in drop down, but doesn’t reverse, displays as oldest first, with no reverse.
The questions:
- I found a note online that said that the created_at attribute data should be in the catalog_product_entity_datetime table all that’s in mine is is news_from_date and news_to_date rows and these were all are null. Can anyone confirm that the create_at values should be in catalog_product_entity_datetime. If so how can I get them from the products into this table?
2. Any other suggestions on things to look at or ways to test what the query is using in the Order By?
Thanks for any help. I am in the weeds!