The bottom of the article is.
Add the "new" label to the new product. Shows the quantity of discounts for discount products.
You can add a piece of code to the catalog/product/list. phtml file in the template folder. The following code is used:
<? Php $ now_tm = Mage: getModel ('Core/date')-> timestamp (time ();?>
<! -- Add new -->
<? Php
$ New_str_tm = strtotime ($ _ product-> getNews_from_date ());
$ New_end_tm = strtotime ($ _ product-> getNews_to_date ());
?>
<Div style = "display: none">
<? Php echo "nows:". $ now_tm;?>
<? Php echo "start:". $ new_str_tm;?>
<? Php echo "end:". $ new_end_tm;?>
</Div>
<? Php if ($ new_str_tm> 0):?>
<? Php if ($ now_tm <$ new_end_tm) | ($ now_tm> $ new_str_tm )&&(! $ New_end_tm):?>
<Div class = "ico_new_bg"> NEW </div>
<? Php endif;?>
<? Php endif;?>
<! -- Special price -->
<? Php
$ Spe_end_tm = strtotime ($ _ product-> getSpecial_to_date ());
$ Spe_str_tm = strtotime ($ _ product-> getSpecial_from_date ());
$ Spe_pri =$ _ product-> getSpecial_price ();
?>
<? Php $ pri =$ _ product-> getResource ()-> getAttribute ('pric')-> getFrontend ()-> getValue ($ _ product)?>
<? Php if ($ now_tm <$ spe_end_tm) | ($ now_tm> $ spe_str_tm )&&(! $ Spe_end_tm):?>
<? Php if ($ spe_pri) & ($ spe_pri <$ pri):?>
<? Php $ percent = round (100-100 * $ spe_pri/$ pri, 2)?>
<Div class = "ico_percent_bg"> <? Php echo '-'. $ percent?> % </Div>
<? Php endif;?>
<? Php endif;?>
<! -- End -->
The above code is inserted to the corresponding position .. It is best to put it in <? Php // Grid Mode?> After this
After this is done. You also need to change the CSS. Display it in the corresponding position.
. Products-grid. ico_new_bg {height: 33px; font-size: 14px; line-height: 24px; color: # ffffff; background: url (".. /images/ico_bg.png "); position: absolute; margin:-10px-10px 0; padding: 0 10px 0; z-index: 10 ;}
. Products-grid. ico_percent_bg {height: 33px; font-size: 14px; line-height: 24px; color: # ffffff; background: url (".. /images/ico_bg.png "); position: absolute; margin:-10px-10px 0; padding: 0 10px 0; z-index: 10 ;}
The csscode is written under styles.css. Add to/* View Type: Grid .. Products-grid li. item: add the last two lines of code after this line.
Adjust the location of margin to suit your website.