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

Pre-Login Shipping Calculator
 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #11  
Old 05-27-2004, 09:23 PM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default

removed
__________________
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
  #12  
Old 05-28-2004, 05:10 AM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default

Anyone know the variables in 3.4.x that match those of this mod?
__________________
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
  #13  
Old 05-28-2004, 08:10 AM
 
rackit rackit is offline
 

Advanced Member
  
Join Date: Jan 2004
Posts: 31
 

Default

DogByteMan, unfortunately, I've never used 3.4.x so I'm not sure how to work it. If you send me a copy of your cart.php, I might be able to figure it out.
Reply With Quote
  #14  
Old 05-28-2004, 01:12 PM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default

It appears that the variable in this line of code is wrong for 3.4.x

{if $not_logged_message eq "1"}

Anybody know what this should be for 3.4.x in cart_totals.tpl

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> <input type=image alt="Calculate Shipping" src="../skin1/images/calculate.gif" border=0 align=middle name=btnCalculate > {else} Click here to change your zip code {/if} {/if}
__________________
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
  #15  
Old 05-28-2004, 01:38 PM
 
rackit rackit is offline
 

Advanced Member
  
Join Date: Jan 2004
Posts: 31
 

Default

OK, it looks to me like 3.4.x doesn't have the equivalent of that variable, so we'll have to make one. Try adding this somewhere near the top of cart.php.

Code:
if(!$login){ $smarty->assign("not_logged_message","1"); } else{ $smarty->assign("not_logged_message","0"); }

And, as always, BACK UP!
Reply With Quote
  #16  
Old 05-28-2004, 02:14 PM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default

That Did It! \


THANK YOU!!!!
__________________
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
  #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
  #18  
Old 05-28-2004, 07:30 PM
 
rackit rackit is offline
 

Advanced Member
  
Join Date: Jan 2004
Posts: 31
 

Default

\
Reply With Quote
  #19  
Old 05-29-2004, 07:17 AM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default

My post above has been edited to reflect a more consistent look and feel of the X-Cart
__________________
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
  #20  
Old 05-31-2004, 01:09 PM
 
donna8284 donna8284 is offline
 

Newbie
  
Join Date: May 2003
Posts: 7
 

Default

Has anyone gotten this to work on v3.5.8 yet? I had it working on 3.5.1 but have recently upgraded and can not get it to work again. Thanks!!
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 08:09 PM.

   

 
X-Cart forums © 2001-2018