X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   How to show "New Arrival!" Icon (https://forum.x-cart.com/showthread.php?t=8589)

badgesales 08-07-2009 08:18 AM

Re: How to show "New Arrival!" Icon
 
moolman where in products_t.tpl did you insert the code

Thanks

lash 11-08-2009 01:14 AM

Re: How to show "New Arrival!" Icon
 
Instead of the pic I get this showing up:

[img]/skin1/images/new_product.gif[/img]

Do I have to change the image links, how to call for the images in 4.1.9?

JWait 11-08-2009 09:33 AM

Re: How to show "New Arrival!" Icon
 
Try this <img src="{$ImagesDir}/new_product.gif" alt="new" />
This is of course assuming your image is in the skin1/images directory.

lash 11-08-2009 08:48 PM

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.

Phoenixone 06-03-2010 11:30 PM

Re: How to show "New Arrival!" Icon
 
Works on 4.2.2

24md 09-24-2012 01:07 PM

Re: How to show "New Arrival!" Icon
 
Anyone got this working for version 5.2?


All times are GMT -8. The time now is 10:54 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.