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)

jin 07-22-2004 04:46 PM

How to show "New Arrival!" Icon
 
Hi everyone.

I would like to show a little "New Arrival!" graphic icon or text next to the product name in product list and product's detail page.
And I want this icon to show up with products which were added recently(i.e. lastweek, in last 21days, et cetra...).
Could anyone tell me how to do this?

dsparks 07-23-2004 03:54 PM

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}


jin 07-26-2004 03:16 PM

thanks!
 
Sorry for replying late. Didn't notice my post was moved to other section...

Anyway, the code you gave me works totally fine!
Thanks.

24md 09-15-2004 06:48 AM

I have just implemented this addition to my site. It is really useful for highlighting new items.

Thanks for the code.

mosh 12-27-2004 03:38 PM

I can't seem to get it to work. Here is the code, it should be ok.:



{* $Id: products.tpl,v 1.33.2.2 2003/08/26 06:06:22 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}>{in clude 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}/newstar.gif[/img]
{/if}


<font size=1>




{$products[product].descr|truncate:300:"...":true}


</font>
<hr size=1 noshade width=230 align=left>
{if $active_modules.Subscriptions ne "" and $products[product].catalogprice}
{include file="modules/Subscriptions/subscription_info_inlist.tpl"}
{else}
{if $products[product].price ne 0}
{if $products[product].list_price gt 0 and $products[product].price lt $products[product].list_price}
{math equation="100-(price/lprice)*100" price=$products[product].price lprice=$products[product].list_price format="%d" assign=discount}
<font class=MarketPrice>{$lng.lbl_market_price}: <s>
{include file="currency.tpl" value=$products[product].list_price}
</s></font>

{/if}
<font class=ProductPrice>{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].price}</font><font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].price}</font>{if $products[product].list_price gt 0 and $products[product].price lt $products[product].list_price}, save {$discount}%{/if}{if $config.Taxes.use_vat eq "Y" and $products[product].vat gt "0"}, {$lng.lbl_including_vat} {$products[product].vat}%{/if}
{else}
<font class=ProductPrice>{$lng.lbl_enter_your_price}</font>
{/if}
{/if}
{if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"}
{include file="customer/main/buy_now.tpl" product=$products[product]}
{/if}
</td></tr>
</table>






{/section}
{else}
{$lng.lbl_no_products_found}
{/if}
{/if}

nfc5382 12-28-2004 02:51 PM

this is great, thanks!

QVS 12-29-2004 02:50 AM

is there a solution for xcart 4 users, this could be quite a handy mod to have if it works :)

cheers

Mary Jo Robins 12-29-2004 05:46 AM

Works in 4.0.9
 
Quote:

Originally Posted by QVS
is there a solution for xcart 4 users, this could be quite a handy mod to have if it works :)

cheers


I am using the same configuration as stated above and it works fime for me. I am now at 4.0.9

QVS 12-29-2004 03:08 PM

Re: Works in 4.0.9
 
Quote:

Originally Posted by Mary Jo Robins
Quote:

Originally Posted by QVS
is there a solution for xcart 4 users, this could be quite a handy mod to have if it works :)

cheers


I am using the same configuration as stated above and it works fime for me. I am now at 4.0.9


excellent, will give it a whirl.....didnt work first time, but maybe missed something :)

rjcbear 12-29-2004 07:44 PM

I copy and paste the code in the location it was suggested and It did not work for me.

any ideas?


Kind regards,
Ricky

Mary Jo Robins 12-30-2004 02:43 AM

Here is a copy of my products.tpl
The only change I made to the orginal code posted for this mod was to hard code my path to the 'NEW" img file because it is not within my storefront directory


Code:

{* $Id: products.tpl,v 1.45.2.11 2004/12/01 15:15:49 mclap Exp $ *}
{if $active_modules.Feature_Comparison ne '' && $products && $printable ne 'Y'}
{include file="modules/Feature_Comparison/compare_selected_button.tpl"}

{include file="modules/Feature_Comparison/products_check_js.tpl"}
{/if}
{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}
{assign var="discount" value=0}
<TABLE border="0" width="100%">
<TR>
<TD width="90" align="center" valign="top">
{if $active_modules.Special_Offers ne "" and $products[product].have_offers}
{include file="modules/Special_Offers/customer/product_offer_thumb.tpl" product=$products[product]}
{$lng.lbl_see_details}
{else}
<A href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}{if $featured eq 'Y'}&featured{/if}">{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>
{/if}
{if $active_modules.Feature_Comparison ne '' && $products[product].fclassid > 0 && $printable ne 'Y'}




{include file="modules/Feature_Comparison/compare_checkbox.tpl" id=$products[product].productid}
{/if}
</TD>
<TD valign="top">
<FONT class="ProductTitle">{$products[product].product}</FONT>


{$lng.lbl_sku}: {$products[product].productcode}
<FONT size="1">



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]http://www.RobinsCollectables.com/Images/New.gif[/img]


Code:

{/if}


{$products[product].descr|truncate:300:"...":true}


</FONT>
<HR size="1" noshade width="100%" align="left">
{if $products[product].product_type eq "C"}
{include file="buttons/details.tpl" href="product.php?productid=`$products[product].productid`&cat=`$cat`&page=`$navigation_page`"}
{else}
{if $active_modules.Subscriptions ne "" and $products[product].catalogprice}
{include file="modules/Subscriptions/subscription_info_inlist.tpl"}
{else}
{if $products[product].taxed_price ne 0}
{if $products[product].list_price gt 0 and $products[product].taxed_price lt $products[product].list_price}
{math equation="100-(price/lprice)*100" price=$products[product].taxed_price lprice=$products[product].list_price format="%d" assign=discount}
{if $discount gt 0}
<FONT class="MarketPrice">{$lng.lbl_market_price}: <S>
{include file="currency.tpl" value=$products[product].list_price}
</S></FONT>

{/if}
{/if}
<FONT class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].taxed_price}</FONT><FONT class="MarketPrice">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].taxed_price}</FONT>{if $discount gt 0}, {$lng.lbl_save_price} {$discount}%{/if}
{if $products[product].taxes}


<TABLE border="0">
<TR>
<TD>[img]{$ImagesDir}/spacer.gif[/img]</TD>
<TD>{include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes}
</TR>
</TABLE>
{/if}
{if $active_modules.Special_Offers ne "" and $products[product].use_special_price ne ""}
{include file="modules/Special_Offers/customer/product_special_price.tpl" product=$products[product]}
{/if}
{else}
<FONT class="ProductPrice">{$lng.lbl_enter_your_price}</FONT>
{/if}
{/if}
{if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"}
{include file="customer/main/buy_now.tpl" product=$products[product]}
{/if}
{/if}
</TD></TR>
</TABLE>






{/section}
{if $active_modules.Feature_Comparison ne '' && $products && $printable ne 'Y'}
{include file="modules/Feature_Comparison/compare_selected_button.tpl"}

{/if}
{else}
{$lng.txt_no_products_found}
{/if}
{/if}


rjcbear 12-30-2004 08:53 PM

Does it have any thing to do with the fact that I have in my store the items display in 3 columns?

Still not working....... :cry:


Kind regards,
Ricky

PersonalizedFitness 01-04-2005 08:02 AM

I posted the code and it worked .. no problems .. very nice - Thank You for sharing. http://www.vitamancafe.com/store/customer/home.php?cat=345

ETInteractive.com 01-04-2005 08:16 AM

Quote:

Originally Posted by rjcbear
Does it have any thing to do with the fact that I have in my store the items display in 3 columns?

Still not working....... :cry:


Kind regards,
Ricky


If you have multiple columns I believe you need to edit "products_t.tpl"

try that.

rjcbear 01-04-2005 09:16 AM

Thank you I will try that later today and I will let every one know the outcome.

Kind regards,
Ricky

markwhoo 01-04-2005 10:48 AM

This little mod actually looks pretty cool.

I just may give it a whirl to see how it does.

Thanks for sharing!

ghhoz 01-04-2005 12:43 PM

Thanks for a wonderful mod. I have this working on my site in a 3 column layout too for those that mentioned problems in a 3 column cart.

Cheers

rjcbear 01-05-2005 09:46 AM

ETInteractive.com
Quote:

If you have multiple columns I believe you need to edit "products_t.tpl"

I am de the modification to the tpl above and yes it does work. So if you are using more than one colunm edit products_t.tpl.

Thank you so much every one.

Kind regards,
Ricky

markwhoo 01-05-2005 10:09 AM

Definatley works in 4.0.9

I wouls like to know how to add it to the standard product detail page also, this would be nice addition.

As it stands, the only place this icon will show is in my features mod (nice) and in the mail catagory listing.

If you go to individual page, it does not show.

Any ideas out there?

Thanks for the mod, It is a nice touch.

CC 01-05-2005 11:56 AM

I havent tested this, but see if this works 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]{$ImagesDir}/mynew.gif[/img]
{/if}


If you have this showing after the product name inside the main table on the product page the code has to be altered to fit within the dialog code.

All of that is untested, but i am sure it will work.

markwhoo 01-05-2005 12:31 PM

Quote:

Originally Posted by CC
I havent tested this, but see if this works 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]{$ImagesDir}/mynew.gif[/img]
{/if}


If you have this showing after the product name inside the main table on the product page the code has to be altered to fit within the dialog code.

All of that is untested, but i am sure it will work.


Works Great!

Thanks so much for the time you have helped me AND the original posting for the mod itself!

eaglemobiles 01-07-2005 07:07 PM

how add the new image to product
 
i have done what you said, but i dont know how to add this image to product

markwhoo 01-07-2005 07:58 PM

Re: how add the new image to product
 
Quote:

Originally Posted by eaglemobiles
i have done what you said, but i dont know how to add this image to product


If you have done what is posted (and it does work), then all that is left to do is upload modified files unless it was done via webmasters mode window, and then upload the image you have chosen to use as your "NEW Product" pic.

That is it, easy as pie :wink:

CC 01-08-2005 12:18 AM

and make sure you upload your .gif file to the skin1/images directory.

markwhoo 01-08-2005 10:03 AM

Quote:

Originally Posted by CC
and make sure you upload your .gif file to the skin1/images directory.


lol, this is true,

I guess I should have reiterated this myself. I assumed since the instructions were followed it would be done. However, this may have been the issue the entire time...

File structure IS important :wink:

Thanks CC

jamtots 01-10-2005 07:09 PM

Oooh that works great--thanks SO much!! :)

Holly

taltos1 06-01-2006 12:12 PM

Update: To get the "New Product" image in your detailed product pages,
Put the above mentioned code right under

Code:

<TD valign="top" align="left" rowspan="2" width="100">
{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail"}
</TD>
<TD valign="top">
<SPAN class=>


In the /customer/main/product.tpl file

It will put the "new product" image right next to the image thumb.
4.0.18

aescalante 06-01-2006 04:08 PM

Where is the image?
 
I can not see/download the icon image. Can someone re-post it please.

Thanks

taltos1 06-01-2006 08:34 PM

It does not really matter, you can create your own (so it matches you site) and then use that. Just make sure it is not to big. It may push your tables around a bit if it is.

Brainary 11-11-2008 08:44 PM

Re: How to show "New Arrival!" Icon
 
could someone please tell me where I find the skin1/images file to add the graphic there.
and where abouts the skin1/customer/mina/products.tpl file is

JWait 11-12-2008 05:58 AM

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

Originally Posted by Brainary
could someone please tell me where I find the skin1/images file to add the graphic there.
and where abouts the skin1/customer/mina/products.tpl file is


I don't think this modification will work with the 4.1.x version.

davidsaldana 11-15-2008 09:30 PM

Re: How to show "New Arrival!" Icon
 
I have gotten this mod to work in 4.1.9.

Also, dont want to hijack, but would anyone know how to do the same for bestsellers. Lets say something like "top 100 Product".

-ds

davidsaldana 11-17-2008 05:08 PM

Re: How to show "New Arrival!" Icon
 
1 Attachment(s)
Update: We installed this mod, and took it off after two days. We tend to think people do not like seeing this kind of thing, because it raises anxieties, such as:

1. Am I the first one buying this item
2. What if its not good, it really hasnt been tested in the marketplace.
3. Makes me nervous because this company has not been dealing with this product very long.

Although the product might just be new to the site, and not actually new, it will still raise these anxieties.

I know there are people out there who will disagree with this, but I do have some hard facts on increases in our abondonment rate, and decreases in conversion, which I directly attribute to this mod.

But thanks anyway, you never know until you try......

Good Luck.

PS: For those of you who do install this mod, I have attached a neat "new" image for anyone who wants to use it (the one we used)

JWait 11-25-2008 05:01 PM

Re: How to show "New Arrival!" Icon
 
Well, some people are always looking for the latest and greatest. If you don't have "new" items then how does the customer know they are not buying last years model, or an obsolete product? Or worse, how do they know the web site is still active? In other words, "new" is good! 8O

"New"can be overused, like putting it in bestsellers for instance. How can it be a "bestseller" if it is a recent addition? Does that mean your other products don't sell, just the "new" ones? :P It is a double-edged sword.

Customers want to see "change" when they revisit a web site, and "new" equals change. So does "sale", but if either are overused they become pretty much meaningless. I have seen several retail stores that advertise "going out of business" sales for months on end. There was even one that did so for years. When they actually did go out of business recently, no one seemed to pay attention to yet another "going out of business" sale. :?

davidsaldana 11-25-2008 05:16 PM

Re: How to show "New Arrival!" Icon
 
I dont think there is a definitive right response. Some items people want the latest and greatest, but sometimes tried and true is the correct way to go about things. You cant say that what might work for an electronics company, would work for a suit mfg. Two totally different customer needs.

Maybe my post above was a little harsh, but for this particular site, we dont need the latest and greatest.

I totally agree about your statement, that you want to show that your website is "alive", which is what we were trying to do........for us there are otherways, such as 24 hour sales, a clock on the website, a new products section. so on and so forth.

good call....

amy2203 03-02-2009 09:53 AM

Re: How to show "New Arrival!" Icon
 
Hi,

As to how useful it is, it really depends on your industry and marktplace, for me, this will be great.

I can't get it to work in my version though, it looks like it cannot calculate $products[product].add_date it's maybe not available to the template.

If anyone has got it working on 4.1 please let us know how,

amy2203 03-02-2009 09:56 AM

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

It is working, just not on my newproducts.php page!

royng 07-14-2009 04:06 PM

Re: How to show "New Arrival!" Icon
 
Very confusing, So, does it work with 4.1.11?

If so, can someone please post the code the we need to add,

Thanks!

moomal 07-25-2009 10:03 AM

Re: How to show "New Arrival!" Icon
 
I did this on 4.2 in products_t.tpl (before reading this post) using the following code:

{if $smarty.now-$product.add_date lt 2629743}NEW!{/if}

We're using styled text, but obviously you could replace NEW! with an image if that suits your needs better.

The 2629743 is the number of seconds in a month, as we wanted anything added in the last month to be marked as new. If you want a different time period, you just need to figure out how many seconds long it is and then use it in place of 2629743.

royng 08-06-2009 03:32 PM

Re: How to show "New Arrival!" Icon
 
Anyone have a complete working code for this "New Arrival"?


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

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