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 > Dev Questions
 
Thread Tools Search this Thread
  #191  
Old 03-17-2007, 01:00 PM
 
TheMommyMarketplace TheMommyMarketplace is offline
 

Advanced Member
  
Join Date: Jul 2006
Posts: 41
 

Default Re: Pre-Login Shipping Calculator

I am having trouble with the "Click here to change your zip code" link. All of the previous entries have been converted to links. I tried the text in post #174, but it is not working for me. Here is my cart.php text (sorry, I don't know how to insert it in the post):

# BCSE End
//include "./nocookie_warning.php";

x_session_register("cart");
x_session_register("intershipper_rates");
x_session_register("intershipper_recalc");
x_session_unregister("secure_oid");
x_session_register("extended_userinfo");
x_session_register("anonymous_checkout");
x_session_register("payment_cc_fields");
x_session_register("current_carrier","UPS");
x_session_register("is_sns_action");

# prelogin calculator start
# modified by cart-lab.com to allow US and CA zipcodes
x_session_register("zipcode_estimate");
$trusted_post_variables = array("zip_estimate");
require $xcart_dir."/include/states.php";
if($HTTP_GET_VARS['zip_estimate'] == "clear"){
$zipcode_estimate = "";
func_header_location("cart.php");
}

if(!empty($zip_estimate)){
$zipcode_estimate = $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");
$count = strlen($zipcode_estimate);

if($count < 4){ //checking for 5 digits
$zipcode_estimate = "";}

func_header_location("cart.php#[anchor name]");
}
if($zipcode_estimate != ""){
$count = strlen($zipcode_estimate);
if($count == 5) {
$config["General"]["apply_default_country"] = "Y";
$config["General"]["default_zipcode"] = $zipcode_estimate;
$userinfo["s_zipcode"] = $zipcode_estimate;
$smarty->assign("estimate","NO");
} else {
$config["General"]["apply_default_country"] = "Y";
$config["General"]["default_country"] = "CA";
$config["General"]["default_zipcode"] = $zipcode_estimate;
$userinfo["s_country"] = "CA";
$userinfo["s_zipcode"] = $zipcode_estimate;
$smarty->assign("estimate","NO");
}

}

# prelogin calculator end

Post 174 says to make the link: <a href='https://www.*****.com/store/cart.php?zip_estimate=clear'>Click here to change your zip code</a>

When I do this, I get a 404 error each time I try to change to zip code. Could someone give me VERY basic instructions on how to fix this? My cart.php file is located in my "public_html" directory. I tried changing "store" to "public_html" but I don't really understand what I'm doing & it didn't work. Thanks!
__________________
Amy

X-cart Pro 4.1.9
www.themommymarketplace.com
Reply With Quote
  #192  
Old 03-26-2007, 04:16 PM
 
fredthesam fredthesam is offline
 

Newbie
  
Join Date: Mar 2007
Posts: 7
 

Default Re: Pre-Login Shipping Calculator

Quote:
Originally Posted by TheMommyMarketplace
I tried changing "store" to "public_html" but I don't really understand what I'm doing & it didn't work. Thanks!

Try removing "public_html" from the URL, you just need to reference the link to "http://www.themommymarketplace.com/cart.php?$zipcode_estimate=clear" Also make sure you remove any spaces before or after the word "clear"
__________________
----
Tracy Smith

Version 4.1.8
Reply With Quote
  #193  
Old 05-05-2007, 10:51 PM
 
mltriebe mltriebe is offline
 

Senior Member
  
Join Date: Mar 2006
Posts: 137
 

Default Re: Pre-Login Shipping Calculator

I am using 4.0.18 and one post said the code in post #157 works for that but I can't get it to work. One of my problems is in cart.php I found 3 instances of this, $intershipper_recalc = "Y"; I assumed after the first one. I did try all 3 locations but with no joy.

The problem is after I inserted a zip code the box went away as did all my shipping options. I could not do anything after that change zip codes or shipping options.

I would love to get this working but after 6 hours on a live site I uninstalled it for now until I can get some advice.

Thanks, Mike
__________________
X-Cart 4.3.1
Buy Together Module, AlteredCart
CDSEO Pro
One Page Checkout, AlteredCart
Smart Search, AlteredCart
On Sale, AlteredCart
Reply With Quote
  #194  
Old 05-18-2007, 07:34 AM
  HWT's Avatar 
HWT HWT is offline
 

eXpert
  
Join Date: Jan 2005
Location: Massachusetts, USA
Posts: 392
 

Default Re: Pre-Login Shipping Calculator

Could anybody clue me in on how to get the zip code the customer entered to display after they enter it?

TIA
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10
Reply With Quote
  #195  
Old 05-18-2007, 08:25 AM
  Terrybraley's Avatar 
Terrybraley Terrybraley is offline
 

Senior Member
  
Join Date: Oct 2005
Location: Atlanta Georgia
Posts: 142
 

Default Re: Pre-Login Shipping Calculator

this works for me

<a href='/storename/cart.php?zip_estimate=clear'>Click here to change your zip code</a> ({$userinfo.s_zipcode})
__________________
Road Rash Apparel LLC
www.roadrashapparel.com

X-Cart Gold Ver.4.1.8
DSEFU Mod
PHP 4.3.11
MySQL server 4.1.22-max-log
MySQL client 5.0.18
Web server Apache
Operation system Linux
Perl 5.008
XML parser (expat) 1.95.6
Reply With Quote
  #196  
Old 06-03-2007, 02:08 PM
 
dem dem is offline
 

Member
  
Join Date: Aug 2003
Posts: 22
 

Default Re: Pre-Login Shipping Calculator

I have read through all the post in this thread and am a bit confused. I am running 4.1.7 and would like to add a shipping estimator.

Can somebody point me to a post or two that might work with 4.1.7?

Thanks,
Dean
__________________
Dean Mayes
http://www.alabu.com
x-cart v4.1.9 [unix]
PHP 5.2.5
MySQL 5.0.22
New York, USA
Reply With Quote
  #197  
Old 06-04-2007, 06:48 AM
  HWT's Avatar 
HWT HWT is offline
 

eXpert
  
Join Date: Jan 2005
Location: Massachusetts, USA
Posts: 392
 

Default Re: Pre-Login Shipping Calculator

Quote:
Originally Posted by Terrybraley
this works for me

<a href='/storename/cart.php?zip_estimate=clear'>Click here to change your zip code</a> ({$userinfo.s_zipcode})

Thank you!


dem

I believe I used:

http://forum.x-cart.com/showpost.php?p=53755&postcount=74

make sure you change:

HTML Code:
Click here to change your zip code


to the proper <a href ...> tag. The forum upgrade seems to have messed them up.
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10
Reply With Quote
  #198  
Old 06-22-2007, 12:33 PM
 
mike@eternitywebdev.com mike@eternitywebdev.com is offline
 

Member
  
Join Date: Mar 2007
Posts: 12
 

Default Re: Pre-Login Shipping Calculator

Hey BSCE,

I have X-Cart 4.0.19 I installed your modification but I found a little glitch in my site with it. Goto www.biodieselwarehouse.com then add some items to your cart. Then put in a test zip code....then click CHECKOUT....it will then ask you for all your personal info...but BEFORE entering it....click the Click to change your Zip Code link. It ends up making my layout all screwy. ANy suggestions? Thanks!

-Mike Lannen
-X-Cart Gold 4.0.19
-Linux
-UPS Real Time Calculator


Quote:
Originally Posted by BCSE
I just installed this on a 4.0.4 version today. Here's the code I used:

In cart.php After:
Code:
x_session_register("cart"); x_session_register("intershipper_rates"); x_session_register("intershipper_recalc"); x_session_unregister("secure_oid"); x_session_register("extended_userinfo"); x_session_register("anonymous_checkout"); x_session_register("payment_cc_fields"); x_session_register("current_carrier");

Insert:
Code:
x_session_register("zipcode_estimate"); if($zip_estimate == "clear") { $zipcode_estimate = ""; func_header_location("cart.php"); } if(!empty($zip_estimate)) { $zipcode_estimate = $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 = "";} if($mode=="checkout") func_header_location("cart.php?mode=checkout"); else func_header_location("cart.php"); } if($zipcode_estimate != "") { $config["General"]["apply_default_country"] = "Y"; $config["General"]["default_zipcode"] = $zipcode_estimate; $smarty->assign("estimate","NO"); }

Then in skin1/customer/main/cart_totals.tpl Before:
Code:
{if $not_logged_message eq "1"}{$lng.txt_order_total_msg}{/if}

Add:
Code:
{* BCSE Begin *} {if $login} {else} {if $estimate ne "NO"} Enter your zip code to calculate shipping charges. <input type=TEXT name='zip_estimate' size=5 maxlength=5> {include file="buttons/button.tpl" button_title="Calculate Shipping" href="javascript: document.cartform.submit()" js_to_href="Y"} {else} Click here to change your zip code {/if} {/if} {* BCSE End *}

Hope this helps! Thanks for the original code rackit!

Carrie
__________________
Mike
V.4.1.11
V 4.2.2
Reply With Quote
  #199  
Old 06-22-2007, 02:49 PM
 
g0t0pless g0t0pless is offline
 

eXpert
  
Join Date: Jul 2003
Posts: 360
 

Default Re: Pre-Login Shipping Calculator

Quote:
Originally Posted by dem
I have read through all the post in this thread and am a bit confused. I am running 4.1.7 and would like to add a shipping estimator.

Can somebody point me to a post or two that might work with 4.1.7?

Thanks,
Dean

Did I miss the answer for this? I, too, am running 4.1.7 and would like to have this option added.

Thanks
__________________
4.1.7
X-Cart Gold
Product Configurator Module
Advanced Order Management Module
RMA Module
Feature Compare Module
Blue Dream theme by 7Dana.com
Reply With Quote
  #200  
Old 06-23-2007, 09:19 AM
 
chastie chastie is offline
 

Member
  
Join Date: May 2006
Posts: 17
 

Default Re: Pre-Login Shipping Calculator

Thanks rackit for this awesome mod!!
__________________
4.0.18
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 04:31 PM.

   

 
X-Cart forums © 2001-2020