How to check if a product is new in Magento 1.9.0.1?
I tried:
<?php if($_product->getNewProduct()) { ?>
...my HTML code...
<?php } ?>
but it dosn't work. What's wrong with it?
How to check if a product is new in Magento 1.9.0.1?
I tried:
<?php if($_product->getNewProduct()) { ?>
...my HTML code...
<?php } ?>
but it dosn't work. What's wrong with it?
I solved in this way:
<?php
$current_date = Mage::getModel('core/date')->date('Y-m-d');
$from_date = substr($_product->getNewsFromDate(), 0, 10);
$to_date = substr($_product->getNewsToDate(), 0, 10);
$new = ($current_date >= $from_date && $current_date <= $to_date) || ($from_date == '' && $current_date <= $to_date && $to_date != '') || ($from_date != '' && $current_date >= $from_date && $to_date == '') ;
?>
<?php if($new == 1) { ?>
<img src="...
<?php } ?>