X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Showing icon for free shipping on product list page (https://forum.x-cart.com/showthread.php?t=22426)

Shaun 06-11-2006 03:41 AM

Showing icon for free shipping on product list page
 
I implimented this line of code to my product.tpl:

Code:

{if $product.free_shipping eq "Y"} [img]{$ImagesDir}/freeshipping.gif[/img] {/if}

And it works very nicely - http://test.streetortrack.com/13-630A-Canton-Ford-289-302-Aluminum-Front-Sump-Pan-FREE-SHIPPING-pr-17102.html

What I'd like to also display is the another free shipping image under the thumbnail of the product in the product list page - http://test.streetortrack.com/home.php?cat=294

This way the customer wouldn't need to actually load the product details to see that they can save money with free shipping. And I wouldn't need to add the free shipping text to the product name...

Any ideas?

balinor 06-11-2006 04:19 AM

Didn't you already ask this in another thread?

Shaun 06-11-2006 04:52 AM

I asked it in this thread posted 4/25/06 - http://forum.x-cart.com/viewtopic.php?t=28315&highlight= but haven't received any replies.

My question is different than the one in that thread so I started a new topic.

nfc5382 06-11-2006 04:55 AM

add the same code to customer/main/products.tpl (single column layout) and customer/main/products_t.tpl (multi column).

Shaun 06-11-2006 05:04 AM

Where do I put the code to get the image to display under the tumbnail? Here is my /customer/main/products_t.tpl:

Code:

{* $Id: products_t.tpl,v 1.10.2.8 2005/06/06 05:18:43 mclap Exp $ *}
<TABLE border="0" width="100%" cellpadding="0" cellspacing="0"><TR><TD class="TableThumbnailBorder">

<TABLE border="0" width="100%" cellpadding="5" cellspacing="1">

{math equation="floor(100/x)" x=$config.Appearance.products_per_row assign="width"}

{section name=product loop=$products}
{assign var="discount" value=0}

{if %product.index% is div by $config.Appearance.products_per_row}
<TR>
{assign var="cell_counter" value=0}
{/if}

{math equation="x+1" x=$cell_counter assign="cell_counter" }

<TD align="center" valign="top" width="{$width}%" class="DialogBox">
{* SAFETYNET DSEFU MOD *}
{if $enable_seo_links == "Y"}
{$products[product].product}

{else}
{$products[product].product}

{/if}
{* END SAFETYNET DSEFU MOD *}
{$lng.lbl_sku}: {$products[product].productcode}

{if $active_modules.Special_Offers ne "" and $products[product].have_offers}
{include file="modules/Special_Offers/customer/product_offer_thumb.tpl" product=$products[product]}
{else}
<TABLE cellpadding="3" cellspacing="0" border="0"><TR><TD height="100">
{* SAFETYNET DSEFU MOD *}
{if $enable_seo_links == "Y"}
{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}

{else}
{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}

{/if}
{* END SAFETYNET DSEFU MOD *}
</TD></TR>
</TABLE>
{/if}
{* SAFETYNET DSEFU MOD *}
{if $enable_seo_links == "Y"}
{$lng.lbl_see_details}


{else}
{$lng.lbl_see_details}


{/if}
{* END SAFETYNET DSEFU MOD *}
{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="lprice-price" price=$products[product].taxed_price lprice=$products[product].list_price format="%.2f" 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}You save ${$discount}{/if}
{if $products[product].taxes}
{include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes}{/if}
{else}
<FONT class="ProductPrice">{$lng.lbl_enter_your_price}</FONT>
{/if}
{/if}
{if $active_modules.Feature_Comparison ne '' && $products[product].fclassid > 0}


{include file="modules/Feature_Comparison/compare_checkbox.tpl" id=$products[product].productid}
{/if}
{*** Uncomment it if you need 'Buy Now' button ***
{if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"}
{include file="customer/main/buy_now.tpl" product=$products[product]}
{/if}
*** Uncomment it if you need 'Buy Now' button ***}
</TD>

{capture name=prod_index}
{math equation="index+x+1" index=%product.index% x=$config.Appearance.products_per_row}
{/capture}
{if $smarty.capture.prod_index is div by $config.Appearance.products_per_row }
</TR>
{/if}

{/section}

{if $cell_counter lt $config.Appearance.products_per_row}
{section name=rest_cells loop=$config.Appearance.products_per_row start=$cell_counter}
<TD class="DialogBox"></TD>
{/section}
</TR>
{/if}

</TABLE>
</TD></TR></TABLE>
{if $active_modules.Feature_Comparison ne '' && $products && $printable ne 'Y'}
{include file="modules/Feature_Comparison/compare_selected_button.tpl"}

{/if}


nfc5382 06-11-2006 06:01 AM

looks like you are actually using single column format in your link so you need to modify products.tpl not products_t.tpl (but i'd add it to both).

This is from my 4.0.18 (w/o DSEFU) so the code quotes might be slightly different.

customer/products.tpl

look for the following (do a search for product_thumbnail), which is your thumbnail in the listing:
Code:

{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}


add after (the free shipping part):
Code:

{if $products[product].free_shipping eq "Y"} [img]{$ImagesDir}/freeshipping.gif[/img] {/if}

so the final bit should look similar to this:
Code:

{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}

{* -------------------Free shipping ------------------*}
{if $products[product].free_shipping eq "Y"} [img]{$ImagesDir}/freeshipping.gif[/img] {/if}
{* -------------------Free shipping ------------------*}

{if $active_modules.Feature_Comparison ne '' && $products[product].fclassid > 0 && $printable ne 'Y'}


Shaun 06-11-2006 06:26 AM

Hmm, I tried putting:

Code:

{if $product.free_shipping eq "Y"} [img]{$ImagesDir}/freeshipping.gif[/img] {/if}

all over the place in my /customer/main/products.tpl but couldn't get anything to show up the image. Here is my /customer/main/products.tpl:

Code:

{* $Id: products.tpl,v 1.45.2.12 2005/06/06 05:18:43 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]}




{* SAFETYNET DSEFU MOD *}
{if $enable_seo_links == "Y"}
{$lng.lbl_see_details}
{else}
{$lng.lbl_see_details}
{/if}
{* END SAFETYNET DSEFU MOD *}
{else}
{* SAFETYNET DSEFU MOD *}
{if $enable_seo_links == "Y"}
<A href="{seo_link prod_name=$products[product].product prod_id=$products[product].productid}">{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>






{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}
{* END SAFETYNET DSEFU MOD *}
{/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">
{* SAFETYNET DSEFU MOD *}
{if $enable_seo_links == "Y"}
<FONT class="ProductTitle">{$products[product].product}</FONT>
{else}
<FONT class="ProductTitle">{$products[product].product}</FONT>
{/if}
{* END SAFETYNET DSEFU MOD *}


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




{$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="lprice-price" price=$products[product].taxed_price lprice=$products[product].list_price format="%.2f" 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}


nfc5382 06-11-2006 06:35 AM

sorry i copy'pasted your example....


try this one instead!

Code:

{if $products[product].free_shipping eq "Y"} [img]{$ImagesDir}/freeshipping.gif[/img] {/if}

longhorn180 06-11-2006 09:00 AM

Why don't you just put the code into product_thumbnail.tpl. That's what I did to display an image above certain thumbnails and it worked great. I'm using 3.5.14 but I don't see why it wouldn't work in later versions as well.

Shaun 06-11-2006 11:19 AM

Great, that works a treat!


All times are GMT -8. The time now is 07:07 AM.

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