while you creating the custom attribute "Visible on Product View Page on Front-end" set this option to YES it will show the attribute on product page...
Show Custom attributes in product page?
-
01-07-2022 - |
Question
I am new to Magento Go, I want to have two custom fields in the product description page: features and specifications. It seems like I need to use "Custom Attribute" to achieve this, so I did so, but the custom attribute wouldn't show up in the product page? How do I make it so that it would appear in the product page?
Solution
OTHER TIPS
There are few ways you can print products custom attribute as follows :
1. $getPrdocutData = $_product->getData();
this will give you an array of all products attributes, so you can use it.
2. $attributes = $product->getAttributes();
foreach ($attributes as $attribute) {
if ($attribute->getIsVisibleOnFront()) {
$value = $attribute->getFrontend()->getValue($product);
// do something with $value here
}
}
and
3. $productAttrs = Mage::getResourceModel('catalog/product_attribute_collection');
foreach ($productAttrs as $productAttr) {
/** $productAttr Mage_Catalog_Model_Resource_Eav_Attribute */
var_dump($productAttr->getAttributeCode());
}
Please try above piece of code to display product attributes.
To display the contents of attribute on product page you need to add following code in view.phtml file.
<?php echo $_product->getResource()->getAttribute('brand_info')->getFrontend()->getValue($_product); ?>
Add code on product page to display All Attribute of the product define attribute must apply option product view on front page set yes:
<?php echo $this->getLayout()->
createBlock('catalog/product_view_attributes', '',
array('template'=> 'catalog/product/view/attributes.phtml'))->toHtml();
?>
You may be difine selected attribute to use this code:
$Designer = Mage::getModel('catalog/product')->load($_product->getId())->
getAttributeText('manufacturer');
<?php if($Designer): ?>
<div class="details"><p><span>Designer:</span>
<?php echo Mage::getModel('catalog/product')->load($_product->getId())->
getAttributeText('manufacturer');
?></p></div>
<?php endif; ?>