View Single Post
  #2  
Old 07-23-2004, 03:54 PM
 
dsparks dsparks is offline
 

Advanced Member
  
Join Date: Nov 2002
Posts: 34
 

Default

I have been using the following code for over a year. The source below is from my current store version 3.54.

You only need to change one file and add a small graphic image to display the "New" status on items that were added in the last "so many days". I added the image right after where the item title is displayed. I'm sure you can move it anywhere you would like. My image size is 31x12.

The following code will show the "New" icon if the item was added 20 days or less ago.

1. Add your graphic file in folder "skin1/images". I named my graphic file "skin1/images/mynew.gif". Shown below is the icon I use.

http://www.CabdCollectibles.com/store/skin1/images/mynew.gif

2. The file "skin1/customer/main/products.tpl" was changed to add the following code. Just insert the following code after line 12:

Code:
{* // 60 * 60 * 24 * 20 days in unix time = 1728000 *} {if ($products[product].add_date gt $smarty.now - 1728000) and ($products[product].add_date lt $smarty.now)} [img]{$ImagesDir}/mynew.gif[/img] {/if}

>>>>>>>>>> Listed below is the code that is before the above code just for a quick reference point of where to insert the additional code.

Hope it works....


Code:
{* $Id: products.tpl,v 1.36 2003/11/11 14:02:37 svowl Exp $ *} {if $usertype eq "C" and $config.Appearance.products_per_row ne "" and $config.Appearance.products_per_row gt 0 and $config.Appearance.products_per_row lt 4 and ($featured eq "Y" or $config.Appearance.featured_only_multicolumn eq "N")} {include file="customer/main/products_t.tpl" products=$products} {else} {if $products} {section name=product loop=$products} <table border=0 width=100%> <tr><td width=90 align=center valign=top> <a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].tmbn_url} {$lng.lbl_see_details}</a> /td> <td valign=top> {$products[product].product}</font> {* // 60 * 60 * 24 * 20 days in unix time = 1728000 *} {if ($products[product].add_date gt $smarty.now - 1728000) and ($products[product].add_date lt $smarty.now)} [img]{$ImagesDir}/mynew.gif[/img] {/if}
Reply With Quote