![]() |
Here you go...
Code:
Environment components info: |
Quote:
Just guessing here... |
Just tried on 3.5.9 with no success.
I'm using Canada Post RealTime Shipping here. :( I expanded the text field to 6 digits (characters) in the php file and the template, but basically this doesn't work so good for me. |
Rackit,
I think I may have tracked down why this is not working for Fedex or Canada Post. Mod_UPS calls for Code:
$dst_country_code=$userinfo["s_country"]; Mod_CPC (Canada Post Corporation) requires Code:
$cp_dest_country = $userinfo["s_country"]; I believe that the Canada Post server validates the Postal code with the province (state). Mod_Fedex asks for a whole bunch of stuff which is probably beyond keeping this estimator simple. Code:
# do all these queries only if FedEx is present. So because I am concerned with Mod_CPC (Canada Post) I need to add the province (state) data to the information sent by the shipping estimator. I can either 1. Let the customer choose there province from a drop down (in addition to the postal code entry) 2. Have the postal code look-up in PHP for the correct province (state) info. Canadian Postal Codes work like this Letter-Number-Letter<space>Number-Letter-Number ie. R7N 2G6 A1N 9D9 N7X 4J0 The first character a letter dictates which province the postal code is for. List for lookup in PHP purposes. Newfoundland/Labrador - "A" Nova Scotia - "B" Prince Edward Island - "C" New Brunswick - "E" Quebec - "G", "H", "J" Ontario - "K", "L", "M", "N", "P" Manitoba - "R" Saskatchewan - "S" Alberta - "T" British Columbia - "V" Northwest and Nunavut Territories - "X" Yukon Territory - "Y" I could use some help and would be happy to donate or something. I can guarantee that an ENTIRE nation of X-Cart users would be very excited and grateful to have this mod. ;) |
I'd also be delighted to donate for the time it takes to tinker the code to work with FedEx lookup!
|
Is this dead, because I only need a little help with the PHP to add a Canadian Postal Province (state) drop down and have it submit with the postal code.
It's worth some money to me if anyone is listening... |
which parts exactly do you need help with?
|
IN my second to last post (before this one)i chronicled how Canada Post needs one more piece of info over UPS. I need the state.
I think the easiest way is to use a drop down. I am good at Smarty but lousy at PHP. I have no idea how to get started. |
BUMP
|
Can't get this modification to work in 3.5.10
I can't get the zip code calculation to show up in 3.5.10 Can anyone tell me exactly where in the cart_totals.tpl I should insert the code? Thank you very much.
|
Re: Pre-Login Shipping Calculator
Thanks. I'm really interested in ths mod but I have a problem. Any ideas on why this wouldn't work with 4.0? No errors. It just reloads the page without anything changed on the page.
|
Anybody find the correct if statement for 3.5.10 for the cart_totals.tpl? I've scoured the files in 3.5.10, but I can't find the if statement responsible for determining if a customer is logged in or not...in other words, how do you put this into code in 3.5.10...
{if customer not logged in} do this {/if} -Bradley |
Code:
{if $not_logged_message eq "1"} instead of doing this why not just do: Code:
{if $login} {else} (insert code) {/if} For some reason you can't do {if !$login} or {if $login eq null} or {if $login eq false} Just doesn't work in smarty so you have to do the above. |
Thanks again Boomer. I finally figured it out a simple way in 3.5.10... it is below...
{if $login eq ""} All is well now. Many thanks. -Bradley |
Can anyone post the COMLETE code modification for 3.5.10 -- Sorry, but I am a bit green at this. Thanks!
|
PM DogByteMan. He's usually pretty helpful.
|
Here's a bit of an update--
I still do not think this mod works for 3.5.8, and if anyone has managed to get it working, please post what you did. Originally, we tried to get to working using FedEx rates, but that clearly was a problem. Now we are using real time UPS rates, and the mod still does not work. We have triple-checked that all code was entered correctly (would be happy to send files wherever, and also would be willing to pay someone to help get it to work). Oddly, if we DO enter a default country/zip in the general settings, X-cart DOES produce the shipping cost pre-login. One question I have: our site does not require a login (anonymous checkout is permitted). I notice this is different from rack-it's site. Does this matter? I don't think it should because the code is relying on the default zipcode setting, but I'm not sure. Any help would be greatly appreciated! |
Another bit of info that may mean something here: we use HTTPS for the entire checkout process - all cart screens. I noticed that rackit doesn't use a secure server until the final checkout page. Could this be a source of problems here? Is it possible that my cart page never thinks it got zip_code data? Is there any simple code I could add as a test to just "echo" the zip_code that should have been entered?
Also: still will to pay to get this working . . . |
There are a half dozen X- users who will pay for this. No one is listening. That really sucks. What happened to all of the capitalist developers?
|
Personally I think the best method to take with this is just to add a zipcode input field on the product details page and view cart or checkout. I know there is a section of code in cart.php that passes the default information specified in the admin to the shipping routines to calculate a shipping cost before login/register.
anyhow, hth. :wink: |
btw, try this and it should fix the issue for 3.5.8+: open up top.inc.php
find: Code:
if (!in_array($__key, array("HTTP_GET_VARS","HTTP_POST_VARS","HTTP_SERVER_VARS","HTTP_ENV_VARS","HTTP_COOKIE_VARS","HTTP_POST_FILES","__key","__val"))) Code:
if (!in_array($__key, array("HTTP_GET_VARS","HTTP_POST_VARS","HTTP_SERVER_VARS","HTTP_ENV_VARS","HTTP_COOKIE_VARS","HTTP_POST_FILES","__key","__val","_GET","_POST","_SERVER"))) I just noticed this mod uses _GET globals which was capped in 3.5.8+ for security reasons. Although it breaks quite a few mods. hth. ;) |
Thanks very much for the input. This did something, but it did not seem to do the trick. Before the change, we would input a zip code and the screen would refresh, but the shipping would not calculate. Instead, the "Enter your Zip code" input box would remain. Also, after we enter a zip code, the shipping drop down box disappears, and the follow shows up "To calculate shipping costs, please proceed to step one of checkout. anonymous."
Now, after Boomer's suggested change, X-cart seems to get the zip-code entry (because it gives the "To change your zip code click here" option), but it does not calculate shipping. Also, once you have entered a zip code, the "To change your zip code" option is dead--it does not actually work. Our troubleshooting shows: X-Cart IS getting the zip code (it is changing zipcode_estimate) X-Cart IS setting "default country" to "Y" Any thoughts? Thanks! |
Will this work with v4.0.3 ?
|
pre-login shipping calculator
I would really appreciate it if someone could post a pre-login shipping calculator mod for version 4.0.3. I would also like to request that their would be a country drop down menu in addition to the zip/postal code box so that international customers could also figure their shipping costs. Thank you for the assistance.
|
i dunno if anyone else is having this problem, but for some reason when I use this to calculate shipping, it adds NY state sales tax, no matter what zip I put in. the spot that says "Tax" still says n/a, but tax is figured into the order total. i dont want take to be figured out at all unless they are logged in.
i am using 3.5.6, any information would be helpful, thanks. |
I feel this is a very important mod and would like to thank the contributors.
Can anyone confirm that this work with x-cart 4.0.3 and FedEx? (I assume I am using Net::SSLeay since the Admin Summary states that one as active.) |
pre-login shipping calculator
I would really appreciate knowing if someone is having success developing a pre-login shipping calculator for version 4.0.4. I want it to work internationally which would require 2 fields: zip code and country. Zip code could not be limited to 5 digits or only numbers or it would not work for Canada. Please let me know what the possibilities are of getting this. Thanks!
|
Zipcode would really only work with a live shipper like UPS or Fedex. I'm testing this mod on a 3.5.11 setup and using just a zipcode with zone shipping charges won't do anything because x-cart has to know the country and state in order to apply you to the proper zone.
I agree the zipcode mask should be greater than 5 for other country zip codes. But I think allowing the user to choose their country/state should give them the most accurate shipping quote. I'll let you know what I find. |
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"); Insert: Code:
x_session_register("zipcode_estimate"); 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 *} Hope this helps! Thanks for the original code rackit! Carrie |
Thank you
Thank you for the post for 4.0.4 It works great! Any chance of modifying the code a little so that we could get a country field in there and so that international customers could use it. The zip code field would also have to be expanded to accept more that just 5 characters and would need to accept letters as well as numbers since some countries zip codes, like Canada for example, use alfa/numeric codes. I would really appreciate such a modification.
|
Shipping: n/a
One thing I noticed is that even though the prices are listed and are calculated in the total, the shipping line on the cart page says shipping: n/a How could I get the actual shipping price to be listed instead of n/a.
Also in my particular case I offer free shipping over $50 and when free shipping is selected all the prices of the other delivery methods disappear. However, if a different shipping method is selected all the rates reappear in the 'Delivery method' drop down box. I would appreciate any ideas of how to resolve these issues. Thanks so much everyone for the mod. |
On the 4.0.4 version I put this on the shipping is calculated in the drop down and in the shipping line. There isn't any n/a showing up on the site I have this on. Make sure "When a customer isn't logged in, it is presumed that he is from the default country.:" is not checked in the admin general settings.
HTH! Carrie |
Carrie,
If you can get the 4.0.4 mod to work for Canada Post & UPS simultaneously (Canadian 6 character postal codes), I will love you even more than I love you now. Like that is even possible! ;) [-o< If money makes the wheels turn faster, PM me. |
Try this adpboss. ;) I have this working in 4.0.4 for US and Canada realtime shipping. I tested this for FedEx only as I don't have USPS account or UPS account.
In cart.php After: Code:
x_session_register("cart"); Insert: Code:
# BCSE Then in skin1/customer/main/cart_totals.tpl Before: Code:
{if $not_logged_message eq "1"}{$lng.txt_order_total_msg}{/if} Insert: Code:
{* BCSE Begin *} You owe me a beer if this works adpboss ;) Carrie |
Will test today. Cheers.
|
Problem half resolved
Quote:
"When a customer isn't logged in, it is presumed that he is from the default country.:" was not checked. So that wasn't the problem. I restored my skin1/customer/main/cart_totals.tpl and then re-applied the mod it is working correctly now except that when my free shipping option is selected the n/a comes back. If someone has an idea how to make it put 0.00 instead of n/a it would be appreciated. Thank you. |
Couldn't you do something in the tpl like if
Code:
{if $order.shipping_cost eq "0.00"} I just made up the shipping cost varible, I am not sure what it is. |
Carrie,
Works like a charm with Canada Post. I don't have UPS setup yet, but will test again when that happens. Only one small issue I get this error when I first view the cart Quote:
But I think that if I move your code above the cart totals then I can comment out the error text once I figure out what is triggering the error display. I owe you beer. Only problem is, I am in Canada. I am investigating if I can ship booze cross border. Otherwise I may just have to PP you enough for some drinks! Alternately you could just come pay me a visit, because everyone knows, CANADIAN BEER ROX! EDIT Just found that it errors with US Zip codes being fed into Canada Post system, but for my purpose it is a non-issue. 98% of my customers are Canadian anyway. Quote:
|
adpboss,
Great! Glad it works! \:D/ Don't worry about the beer. You'll just have to look me up though if you end up in Ohio so we can go have a drink. ;) Carrie |
free shipping problem
Quote:
Thanks for the tip but this is the opposite of what I want. When the shipping amount equals 0.00 the cart already shows n/a for the shipping price. I would like it show 0.00 instead. For some reason either the tpl or the cart.php is causing it to do this. However, the biggest problem is that when the free shipping is selected all of the prices for the other shipping methods disappear too. The customer has to select a shipping method that costs something in order for the prices to show. When a customer is logged in this problem does not exist. Any help solving this problem would be appreciated. |
All times are GMT -8. The time now is 04:58 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.