X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Pre-Login Shipping Calculator (https://forum.x-cart.com/showthread.php?t=6927)

micromedia 04-28-2006 06:01 PM

Anybody using pre shiipin mod on 4.1.0?

davidsaldana 05-07-2006 09:06 PM

Code:

Ok, I think I'm missing something. I've got this working perfectly, except for the tax. I have my cart set to charge MA sales tax for orders in MA. This works fine on checkout, but with the pre-login shipping calculator, it includes the tax no matter which zip code is input. This is confusing to the user as it shouldn't be showing tax in the total if they're not using a MA zip code.

Any ideas.

I'm in version 4.0.17 by the way.

Thanks,
jeff



Jeff, I had the same problem as you do. I just changed my default city, state and zip to anywhere outside of my state (NY), which has the sales tax.

That should take care of the problem.

-David

nevets1219 07-06-2006 12:50 PM

I have implemented the mentioned code in all of the previous code and I tested it and it works great as far as I can see.

What I tested:
* Product with defined shipping freight.
* Flat tax rate (added extra code to set the default state to another state so tax rate isn't calculated as opposed to changing the default state in the X-Cart admin)
* Combination of above.

I have yet to test it with defined shipping methods but I have added the appropriate mentioned code to handle it. I was wondering what other cosiderations should I be aware of.

Thanks to all the contributors of this great mod.

EDIT: This seems like a good free PHP solution for ZIP to state conversion. I've seen another that used arrays rather than a bunch of cases.

EDIT: Before I implement FEDEX into the system, I heard that it does not play nicely with this great mod, is this true?

nevets1219 07-10-2006 09:10 AM

I made some modifications to the original code (minor ones). The modifications are there to make the site a bit more user-friendly.

In cart.php, change
Code:

func_header_location("cart.php");
to
Code:

func_header_location("cart.php#[anchor name]");
Then in /skin1/customer/main/cart_totals.tpl you add the following to the very top (I preferred very top because it'll include the drop-down box "Select a Carrier" since we have more than just one carrier) add the following
Code:

<a name="[anchor name]></a>
and then changeto
Now everytime the users make a submission it'll scroll back down to your anchor which makes making multiple changes a little better and it'll show what the user choose as the Zip Code so they can reference it in case they forgot or they made a typo.

Also to ask the question again, does this work with Fedex (both import rates and using the mods).

The changes are pretty general so it should apply to all versions but the filenames for the changes might be different.

weswhite 07-13-2006 06:37 AM

Quote:

Originally Posted by micromedia
Anybody using pre shiipin mod on 4.1.0?


Does anybody have this working yet for 4.1 or something that would do the same for 4.1? It would be very nice to have this.

Thanks

ecommerce 08-03-2006 10:19 PM

rackit, interesting mod.

i check out ur site.

i like how u have the shipping discount, tax all pre loging.

however ur tax is not calcualted for ur state. i type a few CA zips and it alwasy gives me n/a tax.
I even typed in ur own zip code.

ecommerce 08-03-2006 10:20 PM

skin1/images/calculate.gif should not be used if ur thinking about multiple languages.

ecommerce 08-03-2006 11:08 PM

booomer, i noticed you hard coded the text messages. any way to make this language compatible?

also, is there any way that when they put the zip code, a separate line showing the tax will show?

ecommerce 08-10-2006 04:59 PM

is this pre login shipping calculations working on 4 0 18?

how do we make it calculat tax at the same time when they
put the zip?

thanks

nevets1219 08-10-2006 08:25 PM

It works for v4.0.18 and it does tax calculation as well (with some minor modification)

g0t0pless 08-18-2006 10:20 PM

4.1.X compatible?

Jon 09-22-2006 02:21 PM

Re: Pre-Login Shipping Calculator
 
To prevent taxes from being calculated until the user logs in, perform the following (This was done on a 3.5.x store):

Open include/func.php and FIND:

Code:

function func_calculate_taxes($products, $customer_info, $shipping_cost, $provider="") {

AFTER ADD:

Code:

global $current_area;

FIND:

Code:

        $return = array("tax_cost" => 0,
                                        "tax_gst" => 0,
                                        "tax_pst" => 0);


AFTER PUT:

Code:

  // WebsiteCM - Don't Show Taxes in the customer area unless we have a customer login
  if ($current_area == "C" && $customer_info['login'] == "") { return $return; }


2coolbaby 09-29-2006 10:10 AM

Re: Pre-Login Shipping Calculator
 
I have a slight problem. The code being provided in quotes in this topic, is showing up wrong in my browser. IE:

Click here to change your zip code:

Just shows up as linked text, so if I just paste it into my template it is unlinked text, so my customers cannot click to change their zip.

I am sure the source code is different than what I am seeing in the quote boxes.
If I look at the source code on the forum it shows up as href and http://cart.php?zip_estimate=clear - obviously that is not correct, so some code added here is being changed by the forum.

Can someone possibly email me the code for this line, including the link format? Or post it here with *'s to keep it from being converted to a link by the forum? I would appreciate it much!

eastman 10-03-2006 09:09 AM

Thanks:
 
Great mod. Thanks to all who did such excellent work.

Here's what I used:
<a href='https://www.*****.com/store/cart.php?zip_estimate=clear'>Click here to change your zip code</a>

jasonroy 10-04-2006 02:57 PM

Re: Pre-Login Shipping Calculator
 
i couldnt get the "change zip code" thing to show up at all... it just isnt visible at all.

2coolbaby 10-05-2006 05:53 AM

Re: Pre-Login Shipping Calculator
 
I am using USPS & I am using Real Time Calculations. I have 4 different usps methods available in my cart, but since adding this it ALWAYS reverts to Priority and does not allow the customer to choose any other method. Maybe it is not this mod and something in my cart. I am just not sure, but people are unhappy with the lack of ability to choose shipping. Anyone else had this problem?

jasonroy 10-20-2006 08:15 AM

Re: Pre-Login Shipping Calculator
 
Since I bought the WebsiteCM EZ Checkout for 4.1.3 I have not been able to get this to work at all. I ended up just completely removing it.

Has anyone got it to work with 4.1.3 EZ Checkout?

jfaust97 10-31-2006 06:42 AM

Re: Pre-Login Shipping Calculator
 
Check out this shipping calculator we had made.

it is on any product, look for the shipping calculator button.

www.budgetgolf.net

rubberneck 10-31-2006 07:01 AM

Re: Pre-Login Shipping Calculator
 
jfaust97
Looks great. Are you offering the coding/instructions?

jfaust97 10-31-2006 07:06 AM

Re: Pre-Login Shipping Calculator
 
Thanks,

We had this made from the guys at www.finestshops.com

Ask for Anton.

Very reasonable pricing.

mattia 11-20-2006 05:45 PM

Re: Pre-Login Shipping Calculator
 
Quote:

Originally Posted by jfaust97
Thanks,

We had this made from the guys at www.finestshops.com

Ask for Anton.

Very reasonable pricing.


Well, he didn't seem very reasonable to me...He said he would only provide this and other solutions if you go host with him.
Too bad, the mod is well done.
Anybody can offer a mod like that for 4.0.15 ?
Thanks

neaisha 01-18-2007 09:48 AM

Re: Pre-Login Shipping Calculator
 
out of curiousity, for those running this mod on 4.0.x, is it only for UPS shipping methods or does it work for USPS and FedEx as well? maybe that's why it's not working for me. it show the tax but not the shipping quote.

2coolbaby 01-18-2007 10:14 AM

Re: Pre-Login Shipping Calculator
 
I am using it soley for USPS, so I know it works for that.

nfc5382 01-19-2007 08:55 AM

Re: Pre-Login Shipping Calculator
 
this is great, thanks

The following works as is for 4.0.18: http://forum.x-cart.com/showpost.php?p=114053&postcount=157

I'm using UPS to Canada and US.

neaisha 01-21-2007 04:25 PM

Re: Pre-Login Shipping Calculator
 
IT WORKS!...for now

i must have missed it completely but you can't have fast lane checkout enabled to use this mod.

if you disable fast lane checkout it, it should work perfectly in 4.1.x

TheMommyMarketplace 01-23-2007 07:42 PM

Re: Pre-Login Shipping Calculator
 
Does this work for 4.0.19 Pro? Are the instructions in post 157 complete? I am completely new to this & don't want to mess anything up! Thanks!

neaisha 01-24-2007 08:24 AM

Re: Pre-Login Shipping Calculator
 
do a full backup of your site.

ftp and copy all files that need to be changed. this way, even if you mess up, you have the originals and can easily ftp them back to the server if it doesn't work.

the instructions on page 8 work with 4.1.x so i assume it'd work with your version too. the only thing "wrong" with the code is that there is a link that should be code. i think it says "click here to change your zip code" and instead of seeing the code, you get the actual link. so you will need to get the source of the link. other than that, it's right.

i'm not sure if fast lane checkout is a 4.1.x feature but if it's on 4.0.x, it has to be disabled for this mod to work.

good luck

neaisha 02-07-2007 10:50 AM

Re: Pre-Login Shipping Calculator
 
i was wondering if someone could tell me how to get the shipping options to display as radio buttons rather than a drop down menu?

rackit 02-09-2007 07:50 AM

Re: Pre-Login Shipping Calculator
 
Wow. I'm surprised to see this thread is still active. I'm even more surprised after installing 4.1.x that there is still no pre-login shipping calculator. What gives!?

consultant 03-14-2007 09:46 AM

Re: Pre-Login Shipping Calculator
 
So there is no pre-checkout ship calc mod for 4.1.x running Fast Lane Checkout??

TheMommyMarketplace 03-17-2007 01:00 PM

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!

fredthesam 03-26-2007 04:16 PM

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"

mltriebe 05-05-2007 10:51 PM

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

HWT 05-18-2007 07:34 AM

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

Terrybraley 05-18-2007 08:25 AM

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})

dem 06-03-2007 02:08 PM

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

HWT 06-04-2007 06:48 AM

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.

mike@eternitywebdev.com 06-22-2007 12:33 PM

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


g0t0pless 06-22-2007 02:49 PM

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

chastie 06-23-2007 09:19 AM

Re: Pre-Login Shipping Calculator
 
Thanks rackit for this awesome mod!! :)


All times are GMT -8. The time now is 12:17 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.