How can i get the Attribute Text just on simple products? and hide on configurable? in Product View Magento.
Thanks
How can i get the Attribute Text just on simple products? and hide on configurable? in Product View Magento.
Thanks
This code should be on any place, and have to run just 1 time. After run this code you can remove it.
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->addAttribute('catalog_product', 'attributename', array(
'group' => 'Geral',
'label' => 'Backend label',
'note' => '',
'type' => 'int', //backend_type
'input' => 'text', //frontend_input
'frontend_class' => '',
'source' => 'sourcetype/attribute_source_type',
'backend' => '',
'frontend' => '',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE,
'required' => true,
'visible_on_front' => false,
'apply_to' => 'simple',
'is_configurable' => false,
'used_in_product_listing' => false,
'sort_order' => 5,
));
Why not just do an exception in view.phtml based on type id?
<?php if($_product->getTypeId() == "configurable"){ ?>
<div class="product-view"> ... </div>
<?php } else { ?>
<div class="product-view"> ... </div>
<?php } ?>