1- Create a attribute as follow:
123

2-Assign it to your attribute set:

3- select this attribute value to yes in product section:

4- Use the following code in list.phtml:

<?php 
if($_product->getNew()){?>
  <div class="new">New</div>       
<?php
 }
?>

Or By Using Code

  <?php
       $now = date("Y-m-d");
       $newsFrom= substr($_f_product->getData('news_from_date'),0,10);
       $newsTo=  substr($_f_product->getData('news_to_date'),0,10);
       if ($now>=$newsFrom && $now<=$newsTo) { 
  ?> 
         <span class="new">NEW</span>
  <?php };
  ?>

Categories: Magento

0 Comments

Leave a Reply

Avatar placeholder

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