View Single Post
  #17  
Old 05-28-2004, 02:39 PM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default

OK, first off a big THANK YOU to rackit for this mod!

rackit's mod for 3.4.x

In Langages under Add New Entry enter the following

lbl_calculate Calculate Calculate


In edit templates - buttons/

create new file calculate.tpl


Open calculate.tpl and insert this code

Code:
<font class=FormButton>{$lng.lbl_calculate} <img { include file="buttons/go_image.tpl" }></font>


In customer/cart.php

Just Below This Code

Code:
# # $Id: cart.php,v 1.153.2.8 2003/09/10 06:14:10 svowl Exp $ # # This script implements shopping cart facility # require "../smarty.php"; require "../config.php"; @include "./https.php"; require "./auth.php"; //include "./nocookie_warning.php";

Add This Code

Code:
if(!$login){ $smarty->assign("not_logged_message","1"); } else{ $smarty->assign("not_logged_message","0"); } x_session_register("cart"); x_session_register("intershipper_rates"); x_session_register("intershipper_recalc"); x_session_unregister("secure_oid"); x_session_register("zipcode_estimate"); if($HTTP_GET_VARS['zip_estimate'] == "clear"){ $zipcode_estimate = ""; func_header_location("cart.php"); } if(!empty($HTTP_POST_VARS['zip_estimate'])){ $zipcode_estimate = $_POST['zip_estimate']; $count = substr_count($zipcode_estimate,"0") + substr_count($zipcode_estimate,"1") + substr_count($zipcode_estimate,"2") + substr_count($zipcode_estimate,"3") + substr_count($zipcode_estimate,"4") + substr_count($zipcode_estimate,"5") + substr_count($zipcode_estimate,"6") + substr_count($zipcode_estimate,"7") + substr_count($zipcode_estimate,"8") + substr_count($zipcode_estimate,"9"); if($count != 5){ //checking for 5 digits $zipcode_estimate = "";} func_header_location("cart.php"); } if($zipcode_estimate != ""){ $config["General"]["apply_default_country"] = "Y"; $config["General"]["default_zipcode"] = $zipcode_estimate; $smarty->assign("estimate","NO"); }

Replacing or Deleting This Existing Code Which Is Already Included In The Above Code

Code:
x_session_register("cart"); x_session_register("intershipper_rates"); x_session_register("intershipper_recalc"); x_session_unregister("secure_oid");


In customer/main/cart_totals.tpl

Right Below This Code

Code:
<TR> <TD nowrap><font class=FormButton>{$lng.lbl_order_total}:</font></TD> <TD>[img]{$ImagesDir}/null.gif[/img] </TD> <TD nowrap align=right><font class=ProductPriceSmall>{include file="currency.tpl" value=$cart.total_cost}</font></TD> <TD nowrap align=right>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$cart.total_cost}</TD> </TABLE>

ADD This Code

Code:
{if $not_logged_message eq "1"} {if $estimate ne "NO"} Enter your zip code to calculate shipping charges. <input type=TEXT name='zip_estimate' size=5 maxlength=5> {if $js_enabled} {include file="buttons/calculate.tpl"} {else} {include file="submit_wo_js.tpl" value=$lng.lbl_calculate} {/if} {else} Click here to change your zip code {/if} {/if}


Your Done!

Again a HUGE THANK YOU to rackit! [/code]
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote