I'm working on building a new Magento shop (this is my first with Magento).
I'm looking to replicate the look of an existing shop for my product pages, at least in terms of layout:
http://www.panamericantool.com/cobalt-drills/drill-stops.html
http://www.panamericantool.com/screw-driver-bits/paint-cutters.html
I've figured out that I need to use grouped products, with simple products to create the kind of thing I'm after.
In the examples above, each product has separate attributes, I assume these are done via different attribute sets in Magento.
However how do they go displaying those different table headings/values in the theme?
I know I can do ->getAttributeName()
or ->getAttribute('attribute_code')
in the grouped.phtml
file, but this would result in a vast amount of if (->getAttributeName() != '')...
and I'd need to change the template when adding more.
I'm sure there is a way of getting all attributes and looping over them, but then how would you differentiate between say the meta_description
attribute (also returned by the $_product->getData()
method) and an attribute I'd want listed in the table?
How could I achieve something akin to what they have?
I'm also concerned about performance the shop will have 5k products at launch, growing to perhaps 25k-30k as we add our remaining stock. Many of these will need different attributes, but I'm guessing I could share attributes between attribute sets without too many performance issues?
Update:
I've carried on playing around with this, I've found this to get all of a products attributes, however I still don't know of a simple way of showing on certain values on a grouped product table?
$attributes = Mage::getModel('catalog/product_attribute_api')->items($_product->getAttributeSetId());
foreach($attributes as $_attribute){
print_r($_attribute);
}