View Single Post
  #33  
Old 03-29-2006, 11:41 PM
 
Lionel Lionel is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 199
 

Default

Guys I need some help please. All works perfect with the mod. However, when clicking on product.tpl to see and add free gift, I get a javascript error (does not affect anything though).

It tells me that 'avail' is undefined.

here is the problem line

Code:
if((mq > 0 && avail > mq) || is_unlimit == 'Y') avail = mq; // Update product quantity

and here is product.tpl on 4.18

Code:
{if $product.distribution eq "" and !($active_modules.Subscriptions ne "" and $subscription)} {if $product.taxed_price eq 0} <FONT class="ProductDetailsTitle">1</FONT><INPUT type="hidden" name="amount" value="1"> {else} {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> {/if} {else} <SCRIPT type="text/javascript" language="JavaScript 1.2"> var min_avail = 1; var avail = 1; var product_avail = 1; </SCRIPT> <FONT class="ProductDetailsTitle">1</FONT><INPUT type="hidden" name="amount" value="1"> {if $product.distribution ne ""}{$lng.txt_product_downloadable}{/if}
__________________
X-Cart Gold 4.0.17 [unix]
X-Cart Gold 4.0.18 [unix]
Reply With Quote