I have a product collection. How does one go about sorting this collection the Magento Way?
Programmatically Sort Product Collection in Magento
collection;product-collectionsorting
collection;product-collectionsorting
I have a product collection. How does one go about sorting this collection the Magento Way?
Best Answer
easymoden00b,Magento have a magic function
addAttributeToSort()
which is sort your product Collection onbasic of product attribute
Format:
Example:
Here i have filter the product collection by
created_at
attribute