Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

CHANGING % SAVED TO $ AMOUNT

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 10-05-2004, 03:32 PM
 
Allan Martel Allan Martel is offline
 

Advanced Member
  
Join Date: Mar 2004
Posts: 72
 

Default

The above needed a little change to work in 4.0.4, so here is the modification:

skin1/customer/main/products.tpl (line 29)

Replace:

Code:
{math equation="100-(price/lprice)*100" price=$products[product].taxed_price lprice=$products[product].list_price format="%d" assign=discount} {if $discount gt 0}

With this:

Code:
{math equation="lprice-price" price=$products[product].taxed_price lprice=$products[product].list_price format="%.2f" assign=discount} {if $discount gt 0}

Replace (line 36)


Code:
<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}

With this:

Code:
<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}


For the multi-column view, edit skin1/customer/main/products_t.tpl

Replace (line 31)

Code:
{math equation="100-(price/lprice)*100" price=$products[product].taxed_price lprice=$products[product].list_price format="%d" assign=discount} {if $discount gt 0}

with

Code:
{math equation="lprice-price" price=$products[product].taxed_price lprice=$products[product].list_price format="%.2f" assign=discount} {if $discount gt 0}

and (line 38 )

Code:
<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}, save {$discount}%{/if} {if $products[product].taxes} {include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes}{/if}

with

Code:
<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}

This uses dollars and cents, so if you just want dollars, replace %.2f with %d

Hope this helps[/code]
__________________
____________
____________

X-Cart v 4.0.14
X-Cart v 4.0.11
____________
____________
Reply With Quote
  #12  
Old 11-02-2004, 07:18 AM
  dalmuti's Avatar 
dalmuti dalmuti is offline
 

eXpert
  
Join Date: Oct 2004
Location: Kansas
Posts: 343
 

Default

Works great in 4.05 for products.tpl but when I change products_t.tpl for multi-column view I get an error.....unexpected {else}

Can anyone tell me what I'm missing or what should be changed?

Thanks,

Dalmuti
__________________
Louise

Studio 57 Designs - X-Cart Customization
Providing X-Cart Services since 2004
Hottest Blog Directory - Submit Your Blog for a Free Listing
Reply With Quote
  #13  
Old 11-29-2004, 03:04 PM
 
sportruck sportruck is offline
 

Advanced Member
  
Join Date: Dec 2003
Posts: 70
 

Default

I think the change listed for products_t.tpl "Replace (line 31)" should insead be the same as the first change in products.tpl ... cut and paste error.
Reply With Quote
  #14  
Old 02-10-2005, 11:27 AM
 
Allan Martel Allan Martel is offline
 

Advanced Member
  
Join Date: Mar 2004
Posts: 72
 

Default

Quote:
Originally Posted by sportruck
I think the change listed for products_t.tpl "Replace (line 31)" should insead be the same as the first change in products.tpl ... cut and paste error.

Sorry, i fixed the error. It was a cut and paste error.

For any interested, this still works for 4.0.11
__________________
____________
____________

X-Cart v 4.0.14
X-Cart v 4.0.11
____________
____________
Reply With Quote
  #15  
Old 02-18-2005, 09:11 PM
 
kirsten kirsten is offline
 

Senior Member
  
Join Date: Feb 2005
Location: Sydney, Australia
Posts: 104
 

Default

I would like to implement this on my site
I have looked at the cust/main/product.tpl but mine is coded differently than the examples above

Could someone please tell me what to take out and what i should replace it with ?
Thanx Kirsten

here is my cust/main/product.tpl

{* $Id: product.tpl,v 1.96.2.16 2004/12/10 13:14:52 max Exp $ *}
{if $active_modules.Special_Offers}
{include file="modules/Special_Offers/customer/product_offers_short_list.tpl" product=$product}
{/if}
{include file="form_validation_js.tpl"}
{if $product.product_type eq "C"}
{include file="modules/Product_Configurator/pconf_customer_product.tpl"}
{else}
{capture name=dialog}
<TABLE border="0" width="100%">
<FORM name="orderform" method="post" action="cart.php?mode=add" onsubmit="javascript: return FormValidation();">
<TR>
<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=>
{if $product.fulldescr ne ""}{$product.fulldescr}{else}{$product.descr}{ /if}
</SPAN>



<TABLE width="100%" cellpadding="0" cellspacing="0" border="0">
<TR><TD colspan="2"><FONT class="ProductDetailsTitle">{$lng.lbl_details}</FONT></TD></TR>
<TR><TD class="Line" height="1" colspan="2">[img]{$ImagesDir}/spacer.gif[/img]</TD></TR>
<TR><TD colspan="2"></TD></TR>
{if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""}
<TR><TD width="30%">{$lng.lbl_quantity}</TD><TD nowrap><SPAN id="product_avail_txt">{if $product.avail gt 0}{$product.avail}</SPAN>{else}{$lng.txt_no}{/if} {$lng.txt_items_available}</TD></TR>
{/if}
{if $product.weight ne "0.00"}<TR><TD width="30%">{$lng.lbl_weight}</TD><TD nowrap><SPAN id="product_weight">{$product.weight}</SPAN> {$config.General.weight_symbol}</TD></TR>{/if}
{if $active_modules.Extra_Fields ne ""}
{include file="modules/Extra_Fields/product.tpl"}
{/if}
{if $active_modules.Feature_Comparison ne ""}
{include file="modules/Feature_Comparison/product.tpl"}
{/if}
{if $active_modules.Subscriptions ne "" and $subscription}
{include file="modules/Subscriptions/subscription_info.tpl"}
{else}
<TR><TD class="ProductPriceConverting" valign="top">{$lng.lbl_price}:</TD>
<TD valign="top">
{if $product.taxed_price ne 0 || $variants ne ''}
<FONT class="ProductDetailsTitle"><SPAN id="product_price">{include file="currency.tpl" value=$product.taxed_price}</SPAN></FONT><FONT class="MarketPrice"> <SPAN id="product_alt_price">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.taxed_price}</SPAN></FONT>
{if $product.taxes}
{include file="customer/main/taxed_price.tpl" taxes=$product.taxes}{/if}
{else}
<INPUT type="text" size="7" name="price">
{/if}
</TD>
</TR>





PRICE INCLUDES GST
</P>


{/if}
</TABLE>



<TABLE border="0" width="100%" cellpadding="0" cellspacing="0">
<TR><TD colspan="2">
<FONT class="ProductDetailsTitle">{$lng.lbl_options}</FONT>
</TD></TR>
<TR><TD class="Line" height="1" colspan="2">[img]{$ImagesDir}/spacer.gif[/img]</TD></TR>
<TR><TD colspan="2"></TD></TR>
{if $active_modules.Product_Options ne ""}
{ include file="modules/Product_Options/customer_options.tpl"}
{/if}
<TR><TD height="25" width="30%">{$lng.lbl_quantity}{if $product.min_amount gt 1}
<FONT class="ProductDetailsTitle">{$lng.txt_need_min_amo unt} {$product.min_amount} {$lng.lbl_items}</FONT>{/if}</TD>
<TD>
{if $config.General.unlimited_products eq "N" and ($product.avail le 0 or $product.avail lt $product.min_amount) and $variants eq ''}
<SCRIPT type="text/javascript" language="JavaScript 1.2">
var min_avail = 1;
var avail = 0;
var product_avail = 0;
</SCRIPT>
{$lng.txt_out_of_stock}
{else}
{if $config.General.unlimited_products eq "Y"}
{math equation="x+1" assign="mq" x=$config.Appearance.max_select_quantity}
{else}
{math equation="x/y" x=$config.Appearance.max_select_quantity y=$product.min_amount assign="tmp"}
{if $tmp<2}
{assign var="minamount" value=$product.min_amount}
{else}
{assign var="minamount" value=1}
{/if}
{math equation="min(maxquantity+minamount, productquantity+1)" assign="mq" maxquantity=$config.Appearance.max_select_quantity minamount=$minamount productquantity=$product.avail}
{/if}
{if $product.distribution eq ""}
{if $product.min_amount le 1}
{assign var="start_quantity" value=1}
{else}
{assign var="start_quantity" value=$product.min_amount}
{/if}
<SCRIPT type="text/javascript" language="JavaScript 1.2">
var min_avail = {$start_quantity|default:1};
var avail = {$mq|default:1}-1;
var product_avail = {$product.avail|default:"0"};
</SCRIPT>
<SELECT id="product_avail" name="amount"{if $active_modules.Product_Options ne '' && $product_options ne ''} onchange="check_wholesale(this.value);"{/if}>
{section name=quantity loop=$mq start=$start_quantity}
<OPTION value="{%quantity.index%}" {if $smarty.get.quantity eq %quantity.index%}selected{/if}>{%quantity.index%}</OPTION>
{/section}
</SELECT>
{else}
<FONT class="ProductDetailsTitle">1</FONT><INPUT type="hidden" name="amount" value="1"> {$lng.txt_product_downloadable}
{/if}
{/if}
</TD></TR>
<TR><TD colspan="2">
<INPUT type="hidden" name="mode" value="add">
{if $variants eq ''}
{include file="customer/main/product_prices.tpl"}
{/if}
{if $config.General.unlimited_products eq "Y" or ($product.avail gt 0 and $product.avail ge $product.min_amount)}
{if $js_enabled}


{if $smarty.get.pconf ne ""}
<INPUT type="hidden" name="slot" value="{$smarty.get.slot}">
<INPUT type="hidden" name="addproductid" value="{$product.productid}">
{include file="buttons/button.tpl" button_title=$lng.lbl_pconf_add_to_configuration style="button" href="javascript:if (FormValidation()) `$ldelim`document.orderform.productid.value='`$sma rty.get.pconf`';document.orderform.action='pconf.p hp';document.orderform.submit()`$rdelim`"}



{/if}
{if $product.forsale ne "B"}
{include file="buttons/add_to_cart.tpl" style="button" href="javascript: if(FormValidation()) document.orderform.submit();"}

{if $login ne "" and $active_modules.Wishlist ne ""}
{include file="customer/add2wl.tpl"}
{/if}
{else}
{$lng.txt_pconf_product_is_bundled}
{/if}
{else}
{include file="submit_wo_js.tpl" value=$lng.lbl_add_to_cart}
{/if}
{/if}
{if $active_modules.Feature_Comparison ne ""}
{include file="modules/Feature_Comparison/product_buttons.tpl"}
{/if}

<INPUT type="image" src="{$ImagesDir}/null.gif" width="10" height="10" border="0" valign="top">

</TD>
</TR></TABLE>
</TD>
<TD align="right" valign="top" width="60">
{if $product.list_price gt 0 and $product.taxed_price lt $product.list_price}<TABLE border="0" width="60"><TR><TD width="55" height="56" class="SaveMoneyLabel" background="{$ImagesDir}/save_money.gif" align="center" valign="middle">




{math equation="100-(price/lprice)*100" price=$product.taxed_price lprice=$product.list_price format="%d" assign=discount}&nbsp
;<SPAN id="save_percent">{ $discount }</SPAN>%
</TD></TR></TABLE>{/if}
</TD>
</TR>
<INPUT type="hidden" name="productid" value="{$product.productid}">
<INPUT type="hidden" name="cat" value="{$smarty.get.cat|escape:"html"}">
<INPUT type="hidden" name="page" value="{$smarty.get.page|escape:"html"}">
</FORM>
</TABLE>
{/capture}
{include file="dialog.tpl" title=$product.producttitle content=$smarty.capture.dialog extra="width=100%"}
{/if}



{include file="customer/main/send_to_friend.tpl" }
{if $active_modules.Detailed_Product_Images ne ""}



{include file="modules/Detailed_Product_Images/product_images.tpl" }
{/if}
{if $active_modules.Upselling_Products ne ""}



{include file="modules/Upselling_Products/related_products.tpl" }
{/if}
{if $active_modules.Recommended_Products ne ""}



{include file="modules/Recommended_Products/recommends.tpl" }
{/if}
{if $active_modules.Customer_Reviews ne ""}



{include file="modules/Customer_Reviews/vote_reviews.tpl" }
{/if}
{if $active_modules.Product_Options ne '' && $product_options ne ''}
<SCRIPT type="text/javascript" language="JavaScript 1.2">
check_options();
</SCRIPT>
{/if}
__________________
Kirsten
X_Cart Gold Version 4.0.11
www.silverimports.com.au
www.diamondimports.com.au
Reply With Quote
  #16  
Old 07-23-2005, 09:01 AM
 
donavichi donavichi is offline
 

X-Adept
  
Join Date: Apr 2004
Location: United Kingdom
Posts: 697
 

Default

dredging this one up just in case anyone else would find it useful and like me couldn't find a solution via the search function in the forum ( are you listening x-cart? )
__________________
Best regards,

Donavichi.
- - -

Website Copywriting || Web Design || FAQs || Home & Garden Blog
Reply With Quote
  #17  
Old 08-17-2005, 08:21 AM
 
gargonzo gargonzo is offline
 

Senior Member
  
Join Date: Nov 2004
Posts: 171
 

Default

hi folks.. i got the list price and sale price to display. But I want to add $ Saved to the template..
Here is my template.. I'm having a tough time since the template has NO mention of the saved %..

send help!!! please.
regards
garz

4.07


Code:
{* $Id: product.tpl,v 1.96.2.11 2004/11/09 14:57:50 max Exp $ *} {include file="form_validation_js.tpl"} {if $product.product_type eq "C"} {include file="modules/Product_Configurator/pconf_customer_product.tpl"} {else} {capture name=dialog} <TABLE border="0" width="100%"> <FORM name="orderform" method="post" action="cart.php?mode=add" OnSubmit="javascript: return FormValidation();"> <TR> {***----ORIGINAL THUMBNAIL---- <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"} ----ORIGINAL THUMBNAIL----***} {***--FIRST DETAILED IMAGE--***} {if $active_modules.Detailed_Product_Images ne ""} {include file="modules/Detailed_Product_Images/product_images_one.tpl" } {/if} </TD> {***--FIRST DETAILED IMAGE--***} </TR> <TR> <TD valign="top"> <SPAN class=> {if $product.fulldescr ne ""}{$product.fulldescr}{else}{$product.descr}{/if} </SPAN> {if $product.have_offers and $active_modules.Special_Offers} {include file="modules/Special_Offers/customer/product_offer_detailed.tpl" product=$product} {/if} <TABLE width="100%" cellpadding="0" cellspacing="0" border="0"> <TR><TD colspan="2"><FONT class="ProductDetailsTitle">{$lng.lbl_details}</FONT></TD></TR> <TR><TD class="Line" height="1" colspan="2">[img]{$ImagesDir}/spacer.gif[/img]</TD></TR> <TR><TD colspan="2"></TD></TR> {if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""} <TR><TD width="30%">{$lng.lbl_quantity}</TD><TD nowrap><SPAN id="product_avail_txt">{if $product.avail gt 0}{$product.avail}</SPAN>{else}{$lng.txt_no}{/if} {$lng.txt_items_available}</TD></TR> {/if} {if $product.weight ne "0.00"}<TR><TD width="30%">{$lng.lbl_weight}</TD><TD nowrap><SPAN id="product_weight">{$product.weight}</SPAN> {$config.General.weight_symbol}</TD></TR>{/if} {if $active_modules.Extra_Fields ne ""} {include file="modules/Extra_Fields/product.tpl"} {/if} {if $active_modules.Feature_Comparison ne ""} {include file="modules/Feature_Comparison/product.tpl"} {/if} {if $active_modules.Subscriptions ne "" and $subscription} {include file="modules/Subscriptions/subscription_info.tpl"} {else} <TR><TD class="ProductPriceConverting" valign="top">{$lng.lbl_price}:</TD> <TD valign="top"> {if $product.taxed_price ne 0 || $variants ne ''} <FONT class="ProductDetailsTitle"><SPAN id="product_price">{include file="currency.tpl" value=$product.taxed_price}</SPAN></FONT><FONT class="MarketPrice"> <SPAN id="product_alt_price">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.taxed_price}</SPAN></FONT> {if $product.taxes} {include file="customer/main/taxed_price.tpl" taxes=$product.taxes}{/if} {else} <INPUT type="text" size="7" name="price"> {/if} </TD> </TR> <TR> <TD class="ProductPriceConverting" valign="top">List Price:</TD> <TD valign="top">{include file="currency.tpl" value=$product.list_price}</TD> </TR> {/if} </TABLE> <TABLE border="0" width="100%" cellpadding="0" cellspacing="0"> <TR><TD colspan="2"> <FONT class="ProductDetailsTitle">{$lng.lbl_options}</FONT> </TD></TR> <TR><TD class="Line" height="1" colspan="2">[img]{$ImagesDir}/spacer.gif[/img]</TD></TR> <TR><TD colspan="2"></TD></TR> {if $active_modules.Product_Options ne ""} { include file="modules/Product_Options/customer_options.tpl"} {/if} <TR><TD height="25" width="30%">{$lng.lbl_quantity}{if $product.min_amount gt 1} <FONT class="ProductDetailsTitle">{$lng.txt_need_min_amount} {$product.min_amount} {$lng.lbl_items}</FONT>{/if}</TD> <TD> {if $config.General.unlimited_products eq "N" and ($product.avail le 0 or $product.avail lt $product.min_amount) and $variants eq ''} <SCRIPT type="text/javascript" language="JavaScript 1.2"> var min_avail = 1; var avail = 0; var product_avail = 0; </SCRIPT> {$lng.txt_out_of_stock} {else} {if $config.General.unlimited_products eq "Y"} {math equation="x+1" assign="mq" x=$config.Appearance.max_select_quantity} {else} {math equation="x/y" x=$config.Appearance.max_select_quantity y=$product.min_amount assign="tmp"} {if $tmp<2} {assign var="minamount" value=$product.min_amount} {else} {assign var="minamount" value=0} {/if} {math equation="min(maxquantity+minamount, productquantity)+1" assign="mq" maxquantity=$config.Appearance.max_select_quantity minamount=$minamount productquantity=$product.avail} {/if} {if $product.distribution eq ""} {if $product.min_amount le 1} {assign var="start_quantity" value=1} {else} {assign var="start_quantity" value=$product.min_amount} {/if} <SCRIPT type="text/javascript" language="JavaScript 1.2"> var min_avail = {$start_quantity|default:1}; var avail = {$mq|default:1}-1; var product_avail = {$product.avail|default:"0"}; </SCRIPT> <SELECT id="product_avail" name="amount"{if $active_modules.Product_Options ne '' && $product_options ne ''} onchange="check_wholesale(this.value);"{/if}> {section name=quantity loop=$mq start=$start_quantity} <OPTION value="{%quantity.index%}" {if $smarty.get.quantity eq %quantity.index%}selected{/if}>{%quantity.index%}</OPTION> {/section} </SELECT> {else} <FONT class="ProductDetailsTitle">1</FONT><INPUT type="hidden" name="amount" value="1"> {$lng.txt_product_downloadable} {/if} {/if} </TD></TR> <TR><TD colspan="2"> <INPUT type="hidden" name="mode" value="add"> {include file="customer/main/product_prices.tpl"} {if $config.General.unlimited_products eq "Y" or ($product.avail gt 0 and $product.avail ge $product.min_amount)} {if $js_enabled} {if $smarty.get.pconf ne ""} <INPUT type="hidden" name="slot" value="{$smarty.get.slot}"> <INPUT type="hidden" name="addproductid" value="{$product.productid}"> {include file="buttons/button.tpl" button_title=$lng.lbl_pconf_add_to_configuration style="button" href="javascript:if (FormValidation()) `$ldelim`document.orderform.productid.value='`$smarty.get.pconf`';document.orderform.action='pconf.php';document.orderform.submit()`$rdelim`"} {/if} {if $product.forsale ne "B"} [img]{$ImagesDir}/add2cart.gif[/img] {if $login ne "" and $active_modules.Wishlist ne ""} {include file="customer/add2wl.tpl"} {/if} {else} {$lng.txt_pconf_product_is_bundled} {/if} {else} {include file="submit_wo_js.tpl" value=$lng.lbl_add_to_cart} {/if} {/if} {if $active_modules.Feature_Comparison ne ""} {include file="modules/Feature_Comparison/product_buttons.tpl"} {/if} <INPUT type="image" src="{$ImagesDir}/null.gif" width="10" height="10" border="0" valign="top"> </TD> </TR></TABLE> </TD> </TR> <INPUT type="hidden" name="productid" value="{$product.productid}"> <INPUT type="hidden" name="cat" value="{$smarty.get.cat|escape:"html"}"> <INPUT type="hidden" name="page" value="{$smarty.get.page|escape:"html"}"> </FORM> </TABLE> {/capture} {include file="dialog.tpl" title=$product.product content=$smarty.capture.dialog extra="width=100%"} {/if} { *** include file="customer/main/send_to_friend.tpl" *** } {if $active_modules.Detailed_Product_Images ne ""} {include file="modules/Detailed_Product_Images/product_images.tpl" } {/if} {if $active_modules.Upselling_Products ne ""} {include file="modules/Upselling_Products/related_products.tpl" } {/if} {if $active_modules.Recommended_Products ne ""} {include file="modules/Recommended_Products/recommends.tpl" } {/if} {if $active_modules.Customer_Reviews ne ""} {include file="modules/Customer_Reviews/vote_reviews.tpl" } {/if} {if $active_modules.Product_Options ne '' && $product_options ne ''} <SCRIPT type="text/javascript" language="JavaScript 1.2"> check_options(); </SCRIPT> {/if}
__________________
xcart ver 4.xx/linux/php
Reply With Quote
  #18  
Old 08-18-2005, 05:36 AM
 
donavichi donavichi is offline
 

X-Adept
  
Join Date: Apr 2004
Location: United Kingdom
Posts: 697
 

Default

try this:

Code:
{* $Id: product.tpl,v 1.96.2.11 2004/11/09 14:57:50 max Exp $ *} {include file="form_validation_js.tpl"} {if $product.product_type eq "C"} {include file="modules/Product_Configurator/pconf_customer_product.tpl"} {else} {capture name=dialog} <TABLE border="0" width="100%"> <FORM name="orderform" method="post" action="cart.php?mode=add" OnSubmit="javascript: return FormValidation();"> <TR> {***----ORIGINAL THUMBNAIL---- <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"} ----ORIGINAL THUMBNAIL----***} {***--FIRST DETAILED IMAGE--***} {if $active_modules.Detailed_Product_Images ne ""} {include file="modules/Detailed_Product_Images/product_images_one.tpl" } {/if} </TD> {***--FIRST DETAILED IMAGE--***} </TR> <TR> <TD valign="top"> <SPAN class=> {if $product.fulldescr ne ""}{$product.fulldescr}{else}{$product.descr}{/if} </SPAN> {if $product.have_offers and $active_modules.Special_Offers} {include file="modules/Special_Offers/customer/product_offer_detailed.tpl" product=$product} {/if} <TABLE width="100%" cellpadding="0" cellspacing="0" border="0"> <TR><TD colspan="2"><FONT class="ProductDetailsTitle">{$lng.lbl_details}</FONT></TD></TR> <TR><TD class="Line" height="1" colspan="2">[img]{$ImagesDir}/spacer.gif[/img]</TD></TR> <TR><TD colspan="2"></TD></TR> {if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""} <TR><TD width="30%">{$lng.lbl_quantity}</TD><TD nowrap><SPAN id="product_avail_txt">{if $product.avail gt 0}{$product.avail}</SPAN>{else}{$lng.txt_no}{/if} {$lng.txt_items_available}</TD></TR> {/if} {if $product.weight ne "0.00"}<TR><TD width="30%">{$lng.lbl_weight}</TD><TD nowrap><SPAN id="product_weight">{$product.weight}</SPAN> {$config.General.weight_symbol}</TD></TR>{/if} {if $active_modules.Extra_Fields ne ""} {include file="modules/Extra_Fields/product.tpl"} {/if} {if $active_modules.Feature_Comparison ne ""} {include file="modules/Feature_Comparison/product.tpl"} {/if} {if $active_modules.Subscriptions ne "" and $subscription} {include file="modules/Subscriptions/subscription_info.tpl"} {else} <TR><TD class="ProductPriceConverting" valign="top">{$lng.lbl_price}:</TD> <TD valign="top"> {if $product.taxed_price ne 0 || $variants ne ''} <FONT class="ProductDetailsTitle"><SPAN id="product_price">{include file="currency.tpl" value=$product.taxed_price}</SPAN></FONT><FONT class="MarketPrice"> <SPAN id="product_alt_price">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.taxed_price}</SPAN></FONT> {if $product.taxes} {include file="customer/main/taxed_price.tpl" taxes=$product.taxes}{/if} {else} <INPUT type="text" size="7" name="price"> {/if} </TD> </TR> <TR> <TD class="ProductPriceConverting" valign="top">List Price:</TD> <TD valign="top">{include file="currency.tpl" value=$product.list_price}</TD> </TR> {/if} </TABLE> <TABLE border="0" width="100%" cellpadding="0" cellspacing="0"> <TR><TD colspan="2"> <FONT class="ProductDetailsTitle">{$lng.lbl_options}</FONT> </TD></TR> <TR><TD class="Line" height="1" colspan="2">[img]{$ImagesDir}/spacer.gif[/img]</TD></TR> <TR><TD colspan="2"></TD></TR> {if $active_modules.Product_Options ne ""} { include file="modules/Product_Options/customer_options.tpl"} {/if} <TR><TD height="25" width="30%">{$lng.lbl_quantity}{if $product.min_amount gt 1} <FONT class="ProductDetailsTitle">{$lng.txt_need_min_amount} {$product.min_amount} {$lng.lbl_items}</FONT>{/if}</TD> <TD> {if $config.General.unlimited_products eq "N" and ($product.avail le 0 or $product.avail lt $product.min_amount) and $variants eq ''} <SCRIPT type="text/javascript" language="JavaScript 1.2"> var min_avail = 1; var avail = 0; var product_avail = 0; </SCRIPT> {$lng.txt_out_of_stock} {else} {if $config.General.unlimited_products eq "Y"} {math equation="x+1" assign="mq" x=$config.Appearance.max_select_quantity} {else} {math equation="x/y" x=$config.Appearance.max_select_quantity y=$product.min_amount assign="tmp"} {if $tmp<2} {assign var="minamount" value=$product.min_amount} {else} {assign var="minamount" value=0} {/if} {math equation="min(maxquantity+minamount, productquantity)+1" assign="mq" maxquantity=$config.Appearance.max_select_quantity minamount=$minamount productquantity=$product.avail} {/if} {if $product.distribution eq ""} {if $product.min_amount le 1} {assign var="start_quantity" value=1} {else} {assign var="start_quantity" value=$product.min_amount} {/if} <SCRIPT type="text/javascript" language="JavaScript 1.2"> var min_avail = {$start_quantity|default:1}; var avail = {$mq|default:1}-1; var product_avail = {$product.avail|default:"0"}; </SCRIPT> <SELECT id="product_avail" name="amount"{if $active_modules.Product_Options ne '' && $product_options ne ''} onchange="check_wholesale(this.value);"{/if}> {section name=quantity loop=$mq start=$start_quantity} <OPTION value="{%quantity.index%}" {if $smarty.get.quantity eq %quantity.index%}selected{/if}>{%quantity.index%}</OPTION> {/section} </SELECT> {else} <FONT class="ProductDetailsTitle">1</FONT><INPUT type="hidden" name="amount" value="1"> {$lng.txt_product_downloadable} {/if} {/if} </TD></TR> <TR><TD colspan="2"> <INPUT type="hidden" name="mode" value="add"> {include file="customer/main/product_prices.tpl"} {if $config.General.unlimited_products eq "Y" or ($product.avail gt 0 and $product.avail ge $product.min_amount)} {if $js_enabled} {if $smarty.get.pconf ne ""} <INPUT type="hidden" name="slot" value="{$smarty.get.slot}"> <INPUT type="hidden" name="addproductid" value="{$product.productid}"> {include file="buttons/button.tpl" button_title=$lng.lbl_pconf_add_to_configuration style="button" href="javascript:if (FormValidation()) `$ldelim`document.orderform.productid.value='`$smarty.get.pconf`';document.orderform.action='pconf.php';document.orderform.submit()`$rdelim`"} {/if} {if $product.forsale ne "B"} [img]{$ImagesDir}/add2cart.gif[/img] {if $login ne "" and $active_modules.Wishlist ne ""} {include file="customer/add2wl.tpl"} {/if} {else} {$lng.txt_pconf_product_is_bundled} {/if} {else} {include file="submit_wo_js.tpl" value=$lng.lbl_add_to_cart} {/if} {/if} {if $active_modules.Feature_Comparison ne ""} {include file="modules/Feature_Comparison/product_buttons.tpl"} {/if} <INPUT type="image" src="{$ImagesDir}/null.gif" width="10" height="10" border="0" valign="top"> </TD> </TR></TABLE> </TD> {***** Save Money Label *****} <TD align="right" valign="top" width="60"> {if $product.taxed_price gt 0 and $product.list_price gt 0 and $product.taxed_price lt $product.list_price}<TABLE border="0" width="60"><TR><TD width="55" height="56" class="SaveMoneyLabel" background="{$ImagesDir}/save_money.gif" align="center" valign="middle"> {math equation="100-(price/lprice)*100" price=$product.taxed_price lprice=$product.list_price format="%3.0f" assign=discount} <SPAN id="save_percent">{ $discount }</SPAN>% </TD></TR></TABLE>{/if} </TD> {***** End Save Money Label *****} </TR> <INPUT type="hidden" name="productid" value="{$product.productid}"> <INPUT type="hidden" name="cat" value="{$smarty.get.cat|escape:"html"}"> <INPUT type="hidden" name="page" value="{$smarty.get.page|escape:"html"}"> </FORM> </TABLE> {/capture} {include file="dialog.tpl" title=$product.product content=$smarty.capture.dialog extra="width=100%"} {/if} { *** include file="customer/main/send_to_friend.tpl" *** } {if $active_modules.Detailed_Product_Images ne ""} {include file="modules/Detailed_Product_Images/product_images.tpl" } {/if} {if $active_modules.Upselling_Products ne ""} {include file="modules/Upselling_Products/related_products.tpl" } {/if} {if $active_modules.Recommended_Products ne ""} {include file="modules/Recommended_Products/recommends.tpl" } {/if} {if $active_modules.Customer_Reviews ne ""} {include file="modules/Customer_Reviews/vote_reviews.tpl" } {/if} {if $active_modules.Product_Options ne '' && $product_options ne ''} <SCRIPT type="text/javascript" language="JavaScript 1.2"> check_options(); </SCRIPT> {/if}
__________________
Best regards,

Donavichi.
- - -

Website Copywriting || Web Design || FAQs || Home & Garden Blog
Reply With Quote
  #19  
Old 09-01-2005, 12:17 PM
 
gargonzo gargonzo is offline
 

Senior Member
  
Join Date: Nov 2004
Posts: 171
 

Default

Hi-- everything was working perfectly.. i tried to add Product options to a certain item and it broke the save$ thing..

ver 4.07

Details


Price: $1,908.48
List Price: $2,726.40

You Save: 30


Obviously... you save is now broken.. send help!

here is my code:

Code:
{* $Id: product.tpl,v 1.96.2.11 2004/11/09 14:57:50 max Exp $ *} {include file="form_validation_js.tpl"} {if $product.product_type eq "C"} {include file="modules/Product_Configurator/pconf_customer_product.tpl"} {else} {capture name=dialog} <TABLE border="0" width="100%"> <FORM name="orderform" method="post" action="cart.php?mode=add" OnSubmit="javascript: return FormValidation();"> <TR> {***----ORIGINAL THUMBNAIL---- <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"} ----ORIGINAL THUMBNAIL----***} {***--FIRST DETAILED IMAGE--***} {if $active_modules.Detailed_Product_Images ne ""} {include file="modules/Detailed_Product_Images/product_images_one.tpl" } {/if} </TD> {***--FIRST DETAILED IMAGE--***} </TR> <TR> <TD valign="top"> <SPAN class=> {if $product.fulldescr ne ""}{$product.fulldescr}{else}{$product.descr}{/if} </SPAN> {if $product.have_offers and $active_modules.Special_Offers} {include file="modules/Special_Offers/customer/product_offer_detailed.tpl" product=$product} {/if} <TABLE width="100%" cellpadding="0" cellspacing="0" border="0"> <TR><TD colspan="2"><FONT class="ProductDetailsTitle">{$lng.lbl_details}</FONT></TD></TR> <TR><TD class="Line" height="1" colspan="2">[img]{$ImagesDir}/spacer.gif[/img]</TD></TR> <TR><TD colspan="2"></TD></TR> {if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""} <TR><TD width="30%">{$lng.lbl_quantity}</TD><TD nowrap><SPAN id="product_avail_txt">{if $product.avail gt 0}{$product.avail}</SPAN>{else}{$lng.txt_no}{/if} {$lng.txt_items_available}</TD></TR> {/if} {if $product.weight ne "0.00"}<TR><TD width="30%">{$lng.lbl_weight}</TD><TD nowrap><SPAN id="product_weight">{$product.weight}</SPAN> {$config.General.weight_symbol}</TD></TR>{/if} {if $active_modules.Extra_Fields ne ""} {include file="modules/Extra_Fields/product.tpl"} {/if} {if $active_modules.Feature_Comparison ne ""} {include file="modules/Feature_Comparison/product.tpl"} {/if} {if $active_modules.Subscriptions ne "" and $subscription} {include file="modules/Subscriptions/subscription_info.tpl"} {else} <TR><TD class="ProductPriceConverting" valign="top">{$lng.lbl_price}:</TD> <TD valign="top"> {if $product.taxed_price ne 0 || $variants ne ''} <FONT class="ProductDetailsTitle"><SPAN id="product_price">{include file="currency.tpl" value=$product.taxed_price}</SPAN></FONT><FONT class="MarketPrice"> <SPAN id="product_alt_price">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.taxed_price}</SPAN></FONT> {if $product.taxes} {include file="customer/main/taxed_price.tpl" taxes=$product.taxes}{/if} {else} <INPUT type="text" size="7" name="price"> {/if} </TD> </TR> <TR> <TD class="ProductPriceConverting" valign="top">List Price:</TD> <TD valign="top">{include file="currency.tpl" value=$product.list_price}</TD> </TR> <TR> <TD class="ProductPriceConverting" valign="top"></TD> <TD valign="top"></TD> </TR> <TR> <TD class="ProductPriceConverting" valign="top">You Save:{if $product.taxed_price gt 0 and $product.list_price gt 0 and $product.taxed_price lt $product.list_price} </TD> <TD valign="top"> {math equation="lprice-price" price=$product.price lprice=$product.list_price format="%.2f" assign=discount} <SPAN class="ProductPriceConverting" id="save_percent">${ $discount }</SPAN>{/if}</TD> </TR> {/if} </TABLE> <TABLE border="0" width="100%" cellpadding="0" cellspacing="0"> <TR><TD colspan="2"> <FONT class="ProductDetailsTitle">{$lng.lbl_options}</FONT> </TD></TR> <TR><TD class="Line" height="1" colspan="2">[img]{$ImagesDir}/spacer.gif[/img]</TD></TR> <TR><TD colspan="2"></TD></TR> {if $active_modules.Product_Options ne ""} { include file="modules/Product_Options/customer_options.tpl"} {/if} <TR><TD height="25" width="30%">{$lng.lbl_quantity}{if $product.min_amount gt 1} <FONT class="ProductDetailsTitle">{$lng.txt_need_min_amount} {$product.min_amount} {$lng.lbl_items}</FONT>{/if}</TD> <TD> {if $config.General.unlimited_products eq "N" and ($product.avail le 0 or $product.avail lt $product.min_amount) and $variants eq ''} <SCRIPT type="text/javascript" language="JavaScript 1.2"> var min_avail = 1; var avail = 0; var product_avail = 0; </SCRIPT> {$lng.txt_out_of_stock} {else} {if $config.General.unlimited_products eq "Y"} {math equation="x+1" assign="mq" x=$config.Appearance.max_select_quantity} {else} {math equation="x/y" x=$config.Appearance.max_select_quantity y=$product.min_amount assign="tmp"} {if $tmp<2} {assign var="minamount" value=$product.min_amount} {else} {assign var="minamount" value=0} {/if} {math equation="min(maxquantity+minamount, productquantity)+1" assign="mq" maxquantity=$config.Appearance.max_select_quantity minamount=$minamount productquantity=$product.avail} {/if} {if $product.distribution eq ""} {if $product.min_amount le 1} {assign var="start_quantity" value=1} {else} {assign var="start_quantity" value=$product.min_amount} {/if} <SCRIPT type="text/javascript" language="JavaScript 1.2"> var min_avail = {$start_quantity|default:1}; var avail = {$mq|default:1}-1; var product_avail = {$product.avail|default:"0"}; </SCRIPT> <SELECT id="product_avail" name="amount"{if $active_modules.Product_Options ne '' && $product_options ne ''} onchange="check_wholesale(this.value);"{/if}> {section name=quantity loop=$mq start=$start_quantity} <OPTION value="{%quantity.index%}" {if $smarty.get.quantity eq %quantity.index%}selected{/if}>{%quantity.index%}</OPTION> {/section} </SELECT> {else} <FONT class="ProductDetailsTitle">1</FONT><INPUT type="hidden" name="amount" value="1"> {$lng.txt_product_downloadable} {/if} {/if} </TD></TR> <TR><TD colspan="2"> <INPUT type="hidden" name="mode" value="add"> {include file="customer/main/product_prices.tpl"} {if $config.General.unlimited_products eq "Y" or ($product.avail gt 0 and $product.avail ge $product.min_amount)} {if $js_enabled} {if $smarty.get.pconf ne ""} <INPUT type="hidden" name="slot" value="{$smarty.get.slot}"> <INPUT type="hidden" name="addproductid" value="{$product.productid}"> {include file="buttons/button.tpl" button_title=$lng.lbl_pconf_add_to_configuration style="button" href="javascript:if (FormValidation()) `$ldelim`document.orderform.productid.value='`$smarty.get.pconf`';document.orderform.action='pconf.php';document.orderform.submit()`$rdelim`"} {/if} {if $product.forsale ne "B"} [img]{$ImagesDir}/add2cart.gif[/img] {if $login ne "" and $active_modules.Wishlist ne ""} {include file="customer/add2wl.tpl"} {/if} {else} {$lng.txt_pconf_product_is_bundled} {/if} {else} {include file="submit_wo_js.tpl" value=$lng.lbl_add_to_cart} {/if} {/if} {if $active_modules.Feature_Comparison ne ""} {include file="modules/Feature_Comparison/product_buttons.tpl"} {/if} <INPUT type="image" src="{$ImagesDir}/null.gif" width="10" height="10" border="0" valign="top"> </TD> </TR></TABLE> </TD> </TR> <INPUT type="hidden" name="productid" value="{$product.productid}"> <INPUT type="hidden" name="cat" value="{$smarty.get.cat|escape:"html"}"> <INPUT type="hidden" name="page" value="{$smarty.get.page|escape:"html"}"> </FORM> </TABLE> {/capture} {include file="dialog.tpl" title=$product.product content=$smarty.capture.dialog extra="width=100%"} {/if} { *** include file="customer/main/send_to_friend.tpl" *** } {if $active_modules.Detailed_Product_Images ne ""} {include file="modules/Detailed_Product_Images/product_images.tpl" } {/if} {if $active_modules.Upselling_Products ne ""} {include file="modules/Upselling_Products/related_products.tpl" } {/if} {if $active_modules.Recommended_Products ne ""} {include file="modules/Recommended_Products/recommends.tpl" } {/if} {if $active_modules.Customer_Reviews ne ""} {include file="modules/Customer_Reviews/vote_reviews.tpl" } {/if} {if $active_modules.Product_Options ne '' && $product_options ne ''} <SCRIPT type="text/javascript" language="JavaScript 1.2"> check_options(); </SCRIPT> {/if}
__________________
xcart ver 4.xx/linux/php
Reply With Quote
  #20  
Old 09-23-2005, 10:54 AM
 
salsabeel salsabeel is offline
 

Senior Member
  
Join Date: Jan 2004
Posts: 132
 

Default

How can I get both the % and the amount saved to be listed together in the individual product page (product.tpl)?

i.e., You Save: $xx.xx (xx%)

I tried to play around with the code a bit but I can't quite get it. Any help would be appreciated, thanks!
__________________
X-Cart Platinum 4.6.5
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020