2

I'm having this problem where i want to display a custom attribute outside the product page in magento. (view.phtml).

For example. I would like to display custom attribute (its value) to specific place in list.phtml (not navigation layout) and in home page. I tried so many solution, but nothing worked.

Any guidance or assistance would be very appreciated.

  • Please post some code of what you tried – Marius Oct 14 '14 at 11:47
  • 1
    please be a little more specific on what you want to achieve. – Julien Lachal Oct 14 '14 at 11:50
  • for example: I managed to display wanted attributes with the following code: $_product->getData('shoes_model'); in my product view page. But with this code, i'm not able to call this function when i want to display the attributes on home page of my web site. it returns nothing. – haver15 Oct 14 '14 at 12:02
6

To display a custom product attribute on the product list page

Go Admin -> Catalog -> Attributes -> Manage Attributes

Set "Used in Product Listing" to Yes

Then in 'list.phtml'

Add $_product->getData('attribute_name_here')

  • thanks, this work perfect on list.phtml but on home page isn't not. any idea? – haver15 Oct 14 '14 at 14:51
  • What code are your using on your homepage (I need to know the block type and template)? – Renon Stewart Oct 14 '14 at 15:01
  • i just posted code that I use on my custom theme template. – haver15 Oct 14 '14 at 15:33
  • I just need the code you added to your homepage cms page . Something like {{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/product/list.phtml"}} – Renon Stewart Oct 14 '14 at 15:38
  • is it possible that I don't have block code, as it is empty. I build the theme from scratch, and I only use the code I provided. is it possible to display attribute value anythere on the web site. outside view page and list page? – haver15 Oct 14 '14 at 15:45
2

To display a product manufactures attribute on the product list page

Go Admin -> Catalog -> Attributes -> Manage Attributes

Set "Used in Product Listing" to Yes

Then in 'list.phtml'

 <?php echo $_product->getAttributeText('manufacturer') ?>
  • Need to show this at homepage. any solution? – w3debugger Apr 9 '15 at 9:39
  • Fatal error: Call to a member function getAttributeText() on a non-object – Andhi Irawan Jul 8 '15 at 7:44
1

In Magento-1.9, Display the custom attribute settings

Magento Admin Panel -> Catalog -> Attributes -> Manage Attributes -> Add Attribute ->

Frontend Properties -> Visible on Product View Page on Front-end -> Yes

Once you can try this method.

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.