Kinetic Pulse
  • Home
  • Services
  • Portfolio
  • Blog
  • Terms
  • Contact

Get Attribute Value in Magento

January 3, 2011

Just thought I’d share something cool I found out in Magento.
The client wanted to show a short tagline to describe a product that was to appear on the home page (within a static block) – but both the descrition & Short Description fields were already taken.

After searching around for ages looking for an easy way of doing this, I decide to create a new Attribute for the product called “tagline”.
I made it a text field and made it have Global scope and visible from the front end.

Next I scratched my head trying to find ways of actually extracting the value of this attribute. There seemed to be no definite answer in how to get an attribute value.

Then I stumbled across a post which suggested that getATTRIBUTENAME() would do the trick – which seems to go against every instinct I have as a developer.

But lo and behold using $product ->getTagline() did actually work and retrieve the new attribute “tagline” I had created.
Magento is marvellous – completely baffling most of the time but marvellous!
Update : 11th jan 2011
Talking to a colleague about this – he mentioned that this was a feature of the Zend Framework on which Magento is built. So maybe not as mind-blowing as I first thought. Still pretty cool though…

Share

Facebook Google+ Twitter Pinterest Email

Back to Blog

Testimonials

Thank you guys so much for all that you’ve done helping us to create a really awesome website!! We get such great feedback – everyone loves it & we couldn’t be prouder! Look forward to working with you again soon!
Wild Thyme PlantsWild Thyme Plants
I like it.  I like it a lot !!!

 You have interpreted what I wanted to achieve perfectly considering what you have to play with i.e not redoing the whole thing in the process.

Fiona Simmons-MooreSouth Gloucestershire Parents & Carers
Thanks so much for all your work on this, really appreciated. It’s come on in leaps and bounds since you took over.
Pete KewRedwood Strip Curtains
Amazing and brilliant, Kinetic Pulse have lifted a dream to reality, Highly recommended and great if you are total novice, they know their stuff…Thanks again
Annie LindridgeSalt Yourself Out
Absolutely fantastically professional web developer – I would highly recommend!!! Thank you so much Kinetic Pulse!
Tania MarstonDoris Designs
It’s been fab working with you – we love the site and certainly going to recommend you!
James DaviesThirty Eight Degrees North
Thank you for all of your hard work its looks fab and I am over the moon with it!
Amanda MercerAmanda Mercer Ceramics

Copyright 2025 Kinetic Pulse