Adding Attribute List To Product View
In a recent blog entry I explained how to echo product attributes on the product page, by using a simple calling script. That’s fine and well, but what if you want to echo a large amount of attributes in one go – the type of data that normally is shown in the ‘Additional Info’ tab on the product page. With a couple of simple XML edits, that’s very easy to do:
First open app/design/frontend/base/yourtheme/layout/catalog.xml and enter the following code in the catalog/product_view block:
<block type="catalog/product_view_attributes" name="product.info.attributes" as="attributes" template="catalog/product/view/attributes.phtml"/>
Now open your product view page which is app/design/frontend/base/yourtheme/template/catalog/product/view.phtml. Add the following code to the part of the page where you want the table to appear:
<?php echo $this->getChildHtml('attributes') ?>
On the site that I enabled this on, I duplicated the attributes.phtml page and renamed it attributes-view.phtml and simply linked to this from the XML file. This way you keep a backup of the old one in case you still need it. Keep reading the Magento Blog at E-commerce Website Design for more Magento tips and other ecommerce-related news.
