Wednesday, January 25, 2012

Get Current Product : Magento (Product Data)

// get current product from Mage:registry
$currentproduct = Mage::registry('current_product');

// general product data
echo $currentproduct->getName();
echo $currentproduct->getId();
echo $currentproduct->getProductUrl();
echo $currentproduct->getSku();

// get attributes
echo $currentproduct->getAttributeText('attribute_name');

// get image src
echo $this->helper('catalog/image')->init($currentproduct, 'small_image')->resize(100);

26 comments:

  1. Get Current Product : Magento (Product Data)

    // get current product from Mage:registry
    $currentproduct = Mage::registry('current_product');

    // general product data
    echo $currentproduct->getName();
    echo $currentproduct->getId();
    echo $currentproduct->getProductUrl();
    echo $currentproduct->getSku();

    // get attributes
    echo $currentproduct->getAttributeText('attribute_name');

    // get image src
    echo $this->helper('catalog/image')->init($currentproduct, 'small_image')->resize(100);

    Posted by Afroz Alam
    Email ThisBlogThis!Share to TwitterShare to Facebook
    at 11:48 AM
    No comments:

    Post a Comment

    Newer Post Older Post Home
    Subscribe to: Post Comments (Atom)
    About Me
    My Photo

    Afroz Alam
    New Delhi, New Delhi, India
    Masters in Computer Application from Tilkamanjjhi Bhagalpur University (TMBU), Bhagalpur. Basically a PHP loving Web Developer but has a core love for Magento shopping Cart. Loves to dabble with javascript libraries.

    View my complete profile
    Followers
    Get Current Product : Magento (Product Data)

    // get current product from Mage:registry
    $currentproduct = Mage::registry('current_product');

    // general product data
    echo $currentproduct->getName();
    echo $currentproduct->getId();
    echo $currentproduct->getProductUrl();
    echo $currentproduct->getSku();

    // get attributes
    echo $currentproduct->getAttributeText('attribute_name');

    // get image src
    echo $this->helper('catalog/image')->init($currentproduct, 'small_image')->resize(100);

    Posted by Afroz Alam
    Email ThisBlogThis!Share to TwitterShare to Facebook
    at 11:48 AM
    No comments:

    Post a Comment

    Newer Post Older Post Home
    Subscribe to: Post Comments (Atom)
    About Me
    My Photo

    Afroz Alam
    New Delhi, New Delhi, India
    Masters in Computer Application from Tilkamanjjhi Bhagalpur University (TMBU), Bhagalpur. Basically a PHP loving Web Developer but has a core love for Magento shopping Cart. Loves to dabble with javascript libraries.

    View my complete profile
    Followers

    ReplyDelete
  2. This is a great post. I like this topic.This site has lots of advantage. It helps me in many ways.Thanks for posting this again.
    magento development company in bangalore 

    ReplyDelete
  3. This is a great article, Thanks for giving me this information. Keep posting
    https://reviewscube.com

    ReplyDelete
  4. Pretty amazing work on the author's part and This blog is a five star work.
    brother cartridge

    ReplyDelete
  5. I am unquestionably making the most of your site. You unquestionably have some extraordinary knowledge and incredible stories. extensions for Magento enterprise

    ReplyDelete
  6. You have outdone yourself this time. It is probably the best, most short step by step guide that I have ever seen. Instagram da satis

    ReplyDelete
  7. Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. sandblasting abrasives guide

    ReplyDelete
  8. Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! www.yoursafetyspy.com

    ReplyDelete
  9. I found that site very usefull and this survey is very cirious, I ' ve never seen a blog that demand a survey for this actions, very curious... commercial orange juice machine

    ReplyDelete
  10. You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. kids vanity set

    ReplyDelete
  11. am really happy to say that this is an interesting post to read and I've gained new information from this, Thankyou. I would like to share about Visit W3Schools.com! and how can you achieve benefit from it, give it a go!

    ReplyDelete
  12. Easy to understand Tutorials , thanks for keeping it simple, really helpful. Please give a go at
    magento web development company

    ReplyDelete
  13. Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!THANKS!!!!!! Bodies and Playsuits

    ReplyDelete
  14. An interesting dialogue is price comment. I feel that it is best to write more on this matter, it may not be a taboo topic however usually individuals are not enough to talk on such topics. To the next. Cheers. motorcycle jackets

    ReplyDelete
  15. Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. best air fryer oven

    ReplyDelete
  16. What a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these. Thank you very much. boxing gloves

    ReplyDelete
  17. hi was just seeing if you minded a comment. i like your website and the thme you picked is super. I will be back. biker jacket

    ReplyDelete
  18. The content is utmost interesting! I have completely enjoyed reading your points and have come to the conclusion that you are right about many of them. You are great, and your efforts are outstanding! best home projector under 300

    ReplyDelete
  19. This article gives the light in which we can observe the reality. This is very nice one and gives indepth information. Thanks for this nice article. best wifi projector under 200

    ReplyDelete
  20. A great content material as well as great layout. Your website deserves all of the positive feedback it’s been getting. I will be back soon for further quality contents. berg sandwich prep table

    ReplyDelete
  21. I found this is an informative and interesting post so i think so it is very useful and knowledgeable. I would like to thank you for the efforts you have made in writing this article. top gaming chairs under 100

    ReplyDelete
  22. What a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these. Thank you very much. https://trippyrepublic.com

    ReplyDelete
  23. Great post, Which you have shared here. Your article is very informative and nicely describes the process . Thank you so much. remote meeting software

    ReplyDelete
  24. I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!
    importance of personal branding

    ReplyDelete
  25. This comment has been removed by the author.

    ReplyDelete