The bottom of the article is.
Add a "new" label to the new product. Give discount products, show the quantity of discount.
This can be written on your own a piece of code added to the template folder under the catalog/product/list.phtml. Here is the code
Timestamp (time ());?>
$new _str_tm = Strtotime ($_product->getnews_from_date ());
$new _end_tm = Strtotime ($_product->getnews_to_date ());
?>
0):?>
$new _str_tm) && (! $new _end_tm)):?>
NEW
$spe _end_tm = Strtotime ($_product->getspecial_to_date ());
$spe _str_tm = Strtotime ($_product->getspecial_from_date ());
$spe _pri = $_product->getspecial_price ();
?>
GetResource ()->getattribute (' Price ')->getfrontend ()->getvalue ($_product)?>
$spe _str_tm) && (! $spe _end_tm)):?>
%
The above code is inserted into the appropriate location: It's better to put it behind this.
After this is done. But also to change the CSS. Make it appear in the appropriate location.
. 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; }
This CSS code is added below the styles.css. Add to/* View Type:grid */This below: Products-grid Li.item, add the last two lines of code after this line.
Margin's position adjusts itself to fit your website.
http://www.bkjia.com/PHPjc/477287.html www.bkjia.com true http://www.bkjia.com/PHPjc/477287.html techarticle the bottom of the article is. Add a new label to the new product. Give discount products, show the quantity of discount. This can write your own piece of code added to the template folder under the Cata ...