Another approach...
You can remove the tab and replace it with a tab of your own content from the Product object like this:
Code:
abstract class DefineTabShowSpecification extends \XLite\View\Product\Details\Customer\Page\APage implements \XLite\Base\IDecorator
{
protected function defineTabs()
{
$list = parent::defineTabs();
unset($list['Specification']); //remove default X-cart specification
$tmp = $this->getSpec();
if (!empty($tmp)) { //if the spec field has data...
$list['Specification'] = array(
'list' => 'product.details.page.tab.detailed_spec', //... show it in the specification tab
);
}
return $list;
}
protected function getSpec(){
return $this->getProduct()->specification;
}
}
(also need in skins/default/en/module/DEV-ID/MODULE-NAME/ folder
Code:
{**
* Product details spec tab
*
*
* @ListChild(list="product.details.page.tab.detailed_spec")
*}
{product.specification:h}
)
In this case the client wants to add text and images into the Specification tab. I'd previously added this to the Product Info section in admin so product_translations in the database contains a specification column. The code above display the data from this column.