Using Magento CE 188.8.131.52.
We're trying to find a way to sort products on our site based on which attribute set they were created with. We sells clothes on our site so we have a number of attribute sets such as hats, pants, tees, accessories, etc..
I have the means to sort by attribute:
$_productCollection = Mage::getModel('catalog/product')->getCollection(); $_productCollection->addAttributeToSelect('*'); $_productCollection->addAttributeToSort('display_order', 'ASC'); $_helper = $this->helper('catalog/output');
But this covers attributes within an attribute set. Is there a way to include an "attribute set" field into the catalog template for sorting? I'm currently working with app/design/frontend/mypackage/mytheme/template/catalog/product/list.phtml.
Example: We have a "New" page where products from all the various categories will show. You'll see a new hat, new t-shirt, new pants, etc. but we would like all the new hats to be grouped together (which would be done by sorting attribute set), pants to be together, t-shirts, and so.
**EDIT: ** I found a way to access the product object's attribute set... https://stackoverflow.com/questions/2091375/how-do-i-get-attribute-set-name Now I just to know how to sort by that piece of data.