Ordering a Category Collection by the Newest to Oldest

Well it sounds simple and it is – but only once you remember that there is no “id” field in the flat catalog tables. Every time you add a new category or product – it is assigned a new incremented entity_id there by ordering by the field in DESCENDING order you will always get the newest ones at the top.

 

Published by

BlackRhino

I am a 80's child - the NES, N64 generation old enough to remember Boulder dash - young enough to play Call of Duty. I have been developing in PHP for over 10 years - I've been working in Unity 3D for the past 6 months as I expand my skills into Games Development - Magento development helps to pay the bills.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">