I have this code in my foreach:

<?php echo $this->helper('catalog/output')->productAttribute($_item, $_item->getName() , 'name') ?>

How to get news_from_date and news_to_date with the same structure?

  • it is important where the foreach is and which class $_item belongs to Commented Jun 9, 2016 at 12:11

2 Answers 2


Try Below code:

<?php echo $this->helper('catalog/output')->productAttribute($_item, $_item->getNewsFromDate() , 'news_from_date') ?>

<?php echo $this->helper('catalog/output')->productAttribute($_item, $_item->getNewsToDate() , 'news_to_date') ?>

You should be able to use

echo $item->getData('news_from_date');

echo $item->getData('news_to_date');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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