| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Pre-Login Shipping Calculator | ||||
|
|
Thread Tools | Search this Thread |
#261
|
|||||||
|
|||||||
Re: Pre-Login Shipping Calculator
I'm sure others will correct me if I am wrong but this will be to do with the fact that it is written as a pre login shipping calculator, anonymous users aren't logged in so the test
{if $not_logged_message eq "1"} {if $estimate ne "NO"} is still valid but a customer who logs in makes this invalid and I assume turns the calculator off.
__________________
Chris Barber Version 4.1.9 MOD - BCSE Shipping Estimator MOD - Shopzilla Feed MOD - Price Match with Captcha MOD - Links Manager 2008 MOD - One Page Checkout MOD - Sitemap |
|||||||
#262
|
|||||||
|
|||||||
Re: Pre-Login Shipping Calculator
OK, I recently installed the excellent one page checkout from Bill and this problem recurred in this mod, I asked Bill to help me as I couldn't work out how to make the same changes I made below to acheive the same result in this new mod.
Well Bill was bit confused and asked me why I wasn't using seperate zones ect, which I am, but in trying to resolve the situation myself and with a couple of quizical probes from Bill, I resolved it, and I suspect this situation as well such that no mods are needed to hide non-applicable shipping options. Here's the issue, under General Settings/Shipping Options there is an option labelled 'Enable all shipping methods even if a customer is not logged in:', uncheck this and all is well... Wish I knew this before would have saved a hell of a time trying to code a workaround, although I suspect someone will now tell me it says that on page 16 of this thread , but you live and learn, so make sure this option is unchecked whenever you install this mod as well as the ones indicated in the original post. Quote:
__________________
Chris Barber Version 4.1.9 MOD - BCSE Shipping Estimator MOD - Shopzilla Feed MOD - Price Match with Captcha MOD - Links Manager 2008 MOD - One Page Checkout MOD - Sitemap |
|||||||
#263
|
|||||||
|
|||||||
Re: Pre-Login Shipping Calculator
Hi chris, thanks for looking into it. I unchecked it but still my logged in user does not get the rates
__________________
xcart 4.2 |
|||||||
#264
|
|||||||
|
|||||||
Re: Pre-Login Shipping Calculator
Hi
I resorted to an xcart customisatioin for my clients working with Australian Postcodes. Works very nicely. Shows estimate for ALL delivery methods available. NOTE THE BELOW IS A LIVE SITE. http://www.awomanscharm.com.au/ Add a handbag to your cart and then you'll see the Freight estimator link there. Put in a postcode like 3000 Cheers Chris
__________________
Chris G Humble web designer Version 4.07 - 4.45 |
|||||||
#265
|
|||||||||
|
|||||||||
Re: Pre-Login Shipping Calculator
Anyone have a solution for FedEx? The mode doesnt work with FedEx Direct. FedEx require "State" and "Zip" and they have to match otherwise an error is returned and rates not calculated. The code below is from the request for FedEx rates. This will return rates but if I use the calculator and change only the zip code to one outside Colorado an error is returned.
<DestinationAddress> <StateOrProvinceCode>CO</StateOrProvinceCode> <PostalCode>80012</PostalCode> <CountryCode>US</CountryCode> </DestinationAddress> and this is the error [17-Apr-2008 08:33:03] (shop: 17-Apr-2008 08:33:03) SHIPPING warning: FedEx module error: [61468] Recipient postal code does not match recipient state/province code. Request URI: /cart.php Backtrace: shipping/mod_FEDEX_direct.php:219 shipping/myshipper.php:113 shipping/shipping.php:97 cart.php:449 Anyone know how to fix this?
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#266
|
|||||||
|
|||||||
Re: Pre-Login Shipping Calculator
Ahhh...that explains why it doesn't work for Fedex...sounds like we'd need to add a 'state' field in there, or somehow map the zip to the state.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#267
|
|||||||||
|
|||||||||
Re: Pre-Login Shipping Calculator
Actually there was a field for State which I turned off when I installed the mode. I don;t know if it will work but I will check this.
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#268
|
|||||||||
|
|||||||||
Re: Pre-Login Shipping Calculator
I think I figured it out, seems to work. Needs more testing though. Please report back so we can get this work the best way possible. Changes are in red. X-Cart 4.1.8 without fast lane checkout.
1. in your cart.php # 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"; $trusted_post_variables = array("state_estimate"); 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 length $zipcode_estimate = "";} func_header_location("cart.php"); } if($zipcode_estimate != ""){ $count = strlen($zipcode_estimate); if($count == 5) { $config["General"]["apply_default_country"] = "Y"; $config["General"]["default_country"] = "US"; $config["General"]["apply_default_state"] = "Y"; $config["General"]["default_state"] = $state_estimate; $config["General"]["default_zipcode"] = $zipcode_estimate; $userinfo["s_country"] = "US"; $userinfo["s_state"] = $state_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_state"] = $state_estimate; $config["General"]["default_zipcode"] = $zipcode_estimate; $userinfo["s_country"] = "CA"; $userinfo["s_state"] = $state_estimate; $userinfo["s_zipcode"] = $zipcode_estimate; $smarty->assign("estimate","NO"); } } # prelogin calculator end 2. in your cart_totals.tpl {* BEGIN Shipping Estimate *} {if $login eq ""} {if $estimate ne "NO"} <table width="100%"> <tr> <td> {$lng.lbl_shipping_estimate}: </td> <td> <input type="text" name="zip_estimate" size="8" maxlength="6" /> {include file="main/states.tpl" states=$states name="state_estimate" default=$userinfo.s_state default_country=$userinfo.s_country} </td> <td> {include file="buttons/submit.tpl" button_title="Estimate" style="button" href="javascript: document.cartform.submit();"} </td> </tr> </table> {else} <p style="margin-top: 5px; font-size: 10px;"> {$lng.txt_estimate_shipping_charge}<br /> {$lng.lbl_shipping_change}: <a href="cart.php?zip_estimate=clear">{$userinfo.s_zi pcode}</a> </p> {/if} {else} <p style="margin-top: 5px; font-size: 10px;"> {$lng.txt_logged_shipping_charge} </p> {/if} {* END Shipping Estimate *} I didn't bother to fix the interface so the boxes might not line up. And one glitch I see - nothing prevents customer from inserting for instance zip code for FL and state NE which will probably end up returning wrong rates.
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#269
|
|||||||
|
|||||||
Re: Pre-Login Shipping Calculator
Quote:
Hey man small world, I live in Centreville as well.
__________________
x-cart 4.1.9 |
|||||||
#270
|
|||||||
|
|||||||
Re: Pre-Login Shipping Calculator
Quote:
Make that an even smaller world :P lol We use the same modification ourselves though I modified ours to read off an SQL table that has postal codes for both the US and Canada (with a multi-city selector) for more zone sensitive quotes. |
|||||||
|
|||
X-Cart forums © 2001-2020
|