View Single Post
  #287  
Old 08-13-2008, 04:25 PM
 
ReadytoCover ReadytoCover is offline
 

Senior Member
  
Join Date: Apr 2008
Posts: 124
 

Default Re: Pre-Login Shipping Calculator

I was having the same problem so I paid for the installation. I think I went back over and looked and noticed that the files were slightly different than the free one they gave out. Not going to get into any negative assumptions.

I'm still getting that duplicate showing posted above but at least it works. It could just be because of some other mod. Here are my files, double check with yours


shipping_estimator.tpl

Code:
{if not $login} {if $estimate ne "NO"} <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr><td align="right"> {$lng.txt_enter_zipcode}<br /><br /> <select name='country_estimate'> {section name=country_idx loop=$countries} <option value="{$countries[country_idx].country_code}"{if $config.General.default_country eq $countries[country_idx].country_code} selected="selected"{/if}>{$countries[country_idx].country|amp}</option> {/section} </select> <input type="text" name='zip_estimate' size="8" maxlength="6" /> {include file="buttons/button.tpl" button_title=$lng.lbl_calculate_shipping href="javascript: document.cartform.submit()" js_to_href="Y"} </td></tr> </table> {else} <table cellpadding="1" cellspacing="0" align="right"> {section name=ship_num loop=$shipping} <tr> <td width="5"{if $shipping[ship_num].shippingid eq $cart.shippingid} class="TableHead"{/if}> <input type="radio" name="shippingid" value="{$shipping[ship_num].shippingid}"{if $shipping[ship_num].shippingid eq $cart.shippingid} checked="checked"{else} onclick="javascript: this.form.submit();"{/if} /> </td> <td{if $shipping[ship_num].shippingid eq $cart.shippingid} class="TableHead"{/if} align="left"> {$shipping[ship_num].shipping|trademark:$insert_trademark} {if $shipping[ship_num].shipping_time ne ""} - {$shipping[ship_num].shipping_time}{/if} {if $config.Appearance.display_shipping_cost eq "Y" && ($login ne "" || $config.General.apply_default_country eq "Y" || $cart.shipping_cost gt 0)} ({include file="currency.tpl" value=$shipping[ship_num].rate}){/if} </td> </tr> {if $shipping[ship_num].warning ne ''} <tr> <td>&nbsp;</td> <td class="SmallText">{$shipping[ship_num].warning}</td> </tr> {/if} {sectionelse} <tr><td><font class="ErrorMessage">{$lng.lbl_no_shipping_for_location}</font></td></tr> {/section} </table> <br style="clear:both;" /> <div style="align:right;text-align:right;width:100%;padding-top:10px;"><a href="cart.php?zip_estimate=clear">{$lng.txt_click_change_zip}</a></div> {/if}{/if} <hr size="1" noshade="noshade" width="100%"/>


shipping_estimator.php

Code:
<?php if ( !defined('XCART_SESSION_START') ) { header("Location: ../"); die("Access denied"); } @include_once $xcart_dir."/include/countries.php"; x_session_register("zipcode_estimate"); x_session_register("default_country_estimate"); if($zip_estimate == "clear"){ $zipcode_estimate = ""; func_header_location("cart.php"); } if(!empty($zip_estimate)){ $zipcode_estimate = $zip_estimate; $default_country_estimate= $country_estimate; if($mode=="checkout") func_header_location("cart.php?mode=checkout"); else func_header_location("cart.php"); } if($login != ''){ $zipcode_estimate = ''; $default_country_estimate = ''; } if($zipcode_estimate != ""){ $config["General"]["default_city"] = ''; $config["General"]["default_state"] = ''; $config["General"]["default_country"] = $default_country_estimate; $config["General"]["apply_default_country"] = "Y"; $config["General"]["default_zipcode"] = $zipcode_estimate; $smarty->assign("estimate","NO"); } ?>

Try that out and report back
__________________
x-cart 4.1.9
Reply With Quote