I am trying to emulate the list view that Magento does by default in the "Additional Information" tab:
I have created the \app\code\core\Mage\Catalog\Block\Product\View\Downloads.php
file needed to pull the info for the tab:
<?php
class Mage_Catalog_Block_Product_View_Downloads extends Mage_Core_Block_Template
{
protected $_list;
public function __construct()
{
parent::__construct();
$this->setTemplate('catalog/product/view/downloads.phtml');
}
public function getChildHtmlList()
{
if (is_null($this->_list)) {
$this->_list = array();
foreach ($this->getSortedChildren() as $name) {
$block = $this->getLayout()->getBlock($name);
if (!$block) {
Mage::exception(Mage::helper('catalog')->__('Invalid block: %s.', $name));
}
$this->_list[] = $block->toHtml();
}
}
return $this->_list;
}
}
I have also created the template file to display the info in \app\design\frontend\default\themename\template\catalog\product\view\downloads.phtml
:
<?php foreach ($this->getChildHtmlList() as $_html): ?>
<?php echo $_html ?>
<?php endforeach; ?>
And added the XML to the catalogue.xml
file:
<action method="addTab" translate="title" module="catalog"><alias>downloads</alias><title>Downloads</title><block>catalog/product_view_downloads</block><template>catalog/product/view/downloads.phtml</template></action>
This SHOULD give me a "Downloads" tab with a list view in it the same as the "Additional Information" tab but alas, it doesn't.
How do I tell Magento where to pull the information from - I have set up my attributes in the back end, they are in a group called "Downloads" in the attribute set so it should work.
Thanks, Myles