blog

Magento Custom Attributes in Product List

published in

Magento, Web Development

comments

6

So this one stumped me for a little while – it simply did not make sense as to why I was unable to access a custom attribute assigned to a product in Magento on the product list/product grid (see previous post on the code to do this). You need to ensure the custom attribute is set to display on the front end in order to access the data!

In the admin panel go to Catalog -> Attributes -> Manage Attributes and select your custom attribute. From here set “Visible on Product View Page on Front-end” to yes:

That’s it – done!

This entry was posted in Magento, Web Development and tagged , , , . Bookmark the permalink.

6 Responses to Magento Custom Attributes in Product List

  1. SarahRT says:

    I am having trouble with this in Enterprise edition — is it located in the same place as community edition?

  2. Joshua Valentin says:

    Hi Bret,

    Do have any idea for it to work in /sales/order/items/renderer/default.phmtl??

    I just can not get it to work there.

  3. BretJG says:

    SarahRT – Yes this is located in the same place in Enterprise (at least 1.8+ that I was able to check)

    Bret

  4. BretJG says:

    Hi Joshua,

    I have not used it there specifically but try it using $_item as opposed to $_product – something like echo $_item->getAttributeCode;

    Bret

  5. KuzyaKiev says:

    I have problem. I have 2 servers. Beta and live. On beta this lines work:
    getAttributeText(‘free_shipping_new’);
    echo $this->htmlEscape($_product->getData(‘free_shipping’));
    echo $_helper->productAttribute($_product, $_product->getFreeShipping(), ‘free_shipping’) ;
    echo $_product->getFreeShipping()
    ?>
    In both i use layout
    free_shipping
    Any idea?

    2Joshua Valentin – use layout

  6. BretJG says:

    Well, start with the basics, the attribute was created identically on the production server, correct?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>