View Single Post
  #44  
Old 11-08-2009, 08:48 PM
 
lash lash is offline
 

Senior Member
  
Join Date: Oct 2006
Posts: 138
 

Default Re: How to show "New Arrival!" Icon

Quote:
Originally Posted by JWait
Try this <img src="{$ImagesDir}/new_product.gif" alt="new" />
This is of course assuming your image is in the skin1/images directory.

Thank you very much. That works. I am glad this forum has ppl like you!

I got it to work in 4.1.9:

Just like Dsparks said:

1. Add your graphic file in folder "skin1/images". I named my graphic file "skin1/images/mynew.gif

2. Add the following code to the file "skin1/customer/main/products.tpl" :

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 src="{$ImagesDir}/mynew.gif" alt="New!" />

I added mine on line 22. If you done this it should display this pic on the product pages if you have any new products.

If you want it at detailed product pages you have to add this in product.tlp
Add in customer/main/product.tpl:

Code:
{* // 60 * 60 * 24 * 20 days in unix time = 1728000 *} {if ($product.add_date gt $smarty.now - 1728000) and ($product.add_date lt $smarty.now)} <img src="{$ImagesDir}/mynew.gif" alt="New!" /> {/if}

I added my at line 30, but you might have to test around a little bit to see where it ends up and what fits your site.

So from the original code I just changed how to call for images according to Jwaits suggestions.
__________________
4.1.9
www.lash.se
Reply With Quote