0

I want to display a product brand name in left column of product page. Can you help me to solve this ?

Thanks advance!!!

0

Go to local.xml and put this code:

<catalog_product_view>
    <reference name="left">
        <block type="catalog/product_view" name="product.brandname" as="product_brandname" template="catalog/product/brandname.phtml"/>
    </reference>
</catalog_product_view>

Now create new template file brandname.phtml at

\app\design\frontend\YOUR_PACKAGE\YOUR_THEME\template\catalog\product\brandname.phtml

Add this code in brandname.phtml

<?php $_product = $this->getProduct(); ?>
<?php 
    /* YOU CAN GET ANY PRODUCT ATTRIBUTE HERE. */
    echo $_product->getBrand(); 
?>

Note: Change echo $_product->getBrand(); as per your BRAND attribute code

| improve this answer | |
  • My attribute code is [manufacturer]. Then i want to call echo $_product->getmanufacturer(); ? – Vijayakumar May 21 '16 at 6:33
  • i followed that code it will return nothing. – Vijayakumar May 21 '16 at 6:42
  • I'm sure , you missed some steps. Have you changed to echo $_product->getManufacturer(); ? – Anil Suthar May 21 '16 at 6:45
  • i tried this echo $_product->getAttributeText('manufacturer'); it will working. Now i want to add a link to that brand name, What to do? this link goes to all the product related to that brand name – Vijayakumar May 21 '16 at 7:00
  • It's hard to show here coz it's a different question, please raise a new one, I'll show solution there, thanks – Anil Suthar May 21 '16 at 7:02
0
<?php echo $_product->getAttributeText('brand');?>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.