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
  #131  
Old 07-18-2005, 09:31 AM
 
rackit rackit is offline
 

Advanced Member
  
Join Date: Jan 2004
Posts: 31
 

Default

I don't have time to go through all the pages, but if someone can e-mail me the code, I'll put it in the first post.
Reply With Quote
  #132  
Old 07-18-2005, 10:43 AM
  Jayk's Avatar 
Jayk Jayk is offline
 

eXpert
  
Join Date: Nov 2003
Location: Calgary, Alberta, Canada
Posts: 333
 

Default

Quote:
Originally Posted by rackit
I don't have time to go through all the pages, but if someone can e-mail me the code, I'll put it in the first post.

It's on its way to you.

Thanks,
Jason
__________________
X-Cart Gold 4.4.3
Blog: www.flashinthepan.ca
Reply With Quote
  #133  
Old 07-27-2005, 01:15 PM
 
sbtiti sbtiti is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 32
 

Default

What is the code needed to change if wanting to get this installed on 4.0.9?
__________________
Version 4.0.9
Reply With Quote
  #134  
Old 07-28-2005, 03:35 PM
  Jayk's Avatar 
Jayk Jayk is offline
 

eXpert
  
Join Date: Nov 2003
Location: Calgary, Alberta, Canada
Posts: 333
 

Default

This is the current code I am using, pulled together from the 9 pages of this post. I have used it on 4.0.12 through 4.0.14 and I assume it should work on 4.0.9.

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:
# BCSE x_session_register("zipcode_estimate"); x_session_register("default_country_estimate"); if($zip_estimate == "clear") { $zipcode_estimate = ""; func_header_location("cart.php"); } if(!empty($zip_estimate)) { $zipcode_estimate = $zip_estimate; $default_country_estimate= $country_estimate; if($country_estimate == "US") { $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($country_estimate == "CA" && strlen($zipcode_estimate)!=6) $zipcode_estimate= ""; if($mode=="checkout") func_header_location("cart.php?mode=checkout"); else func_header_location("cart.php"); } if($zipcode_estimate != "") { $config["General"]["default_country"] = $default_country_estimate; $config["General"]["apply_default_country"] = "Y"; $config["General"]["default_zipcode"] = $zipcode_estimate; $smarty->assign("estimate","NO"); } # 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 *} {if $login} {else} {if $estimate ne "NO"} Enter your country and zip/postal code to calculate shipping charges. Country: <select name='country_estimate'> <option value="US">United States <option value="CA">Canada </select> Zip/Postal Code: <input type=TEXT name='zip_estimate' size=6 maxlength=6> {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 *}

Go to main/customer/cart_totals.tpl

Instead of
Code:
{if $cart.taxes and $config.Taxes.display_taxed_order_totals ne "Y"} {foreach key=tax_name item=tax from=$cart.taxes} <TR> <TD nowrap><FONT class="FormButton">{$tax.tax_display_name}{if $tax.rate_type eq "%"} {$tax.rate_value}%{/if}:</FONT></TD> <TD>[img]{$ImagesDir}/null.gif[/img] </TD> <TD nowrap align="right"><FONT class="ProductPriceSmall">{if $login ne "" or $config.General.apply_default_country eq "Y"}{include file="currency.tpl" value=$tax.tax_cost}</FONT></TD> <TD nowrap align="right">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$tax.tax_cost}{else}n/a{assign var="not_logged_message" value="1"}</FONT></TD><TD>{/if}</TD> </TR> {/foreach} {/if}
put
Code:
{if $cart.taxes and $config.Taxes.display_taxed_order_totals ne "Y"} {foreach key=tax_name item=tax from=$cart.taxes} <TR> <TD nowrap><FONT class="FormButton">{$tax.tax_display_name}{if $tax.rate_type eq "%"} {$tax.rate_value}%{/if}:</FONT></TD> <TD>[img]{$ImagesDir}/null.gif[/img] </TD> <TD nowrap align="right"><FONT class="ProductPriceSmall">{if $login ne "" or $estimate eq "NO" or $config.General.apply_default_country eq "Y"}{include file="currency.tpl" value=$tax.tax_cost}</FONT></TD> <TD nowrap align="right">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$tax.tax_cost}{else}n/a{assign var="not_logged_message" value="1"}</FONT></TD><TD>{/if}</TD> </TR> {/foreach} {/if}

That should get the tax to show up instead of n/a.

The only other thing that seems to be needed is as addition of US states for the Sell Online Canada Post Shipping Module to work properly.

Cheers,
Jason
__________________
X-Cart Gold 4.4.3
Blog: www.flashinthepan.ca
Reply With Quote
  #135  
Old 08-04-2005, 10:45 AM
 
sbtiti sbtiti is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 32
 

Default

On this modification, how do we make it so that the default shipping method used is ground?

Also, we get this error on the page before entering a zipcode:

UPS Realtime shipping rate calculation service returned the following error:
The requested service is unavailable between the selected locations. (errorcode: 111210)
Sorry, there are no available shipping methods for your location.:

It sounds like this error is caused because it hasn't yet received the zipcode yet. Is it possible to make it so it doesn't show this error?

Thank you.
__________________
Version 4.0.9
Reply With Quote
  #136  
Old 08-09-2005, 03:06 PM
 
sbtiti sbtiti is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 32
 

Default

bump
__________________
Version 4.0.9
Reply With Quote
  #137  
Old 08-22-2005, 03:04 PM
 
sbtiti sbtiti is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 32
 

Default

How to we prevent this error

Quote:
UPS Realtime shipping rate calculation service returned the following error:
The requested service is unavailable between the selected locations. (errorcode: 111210)
Sorry, there are no available shipping methods for your location.:


from appearing before a zipcode is inputed by the user the first time?
__________________
Version 4.0.9
Reply With Quote
  #138  
Old 08-23-2005, 04:47 PM
 
TJ Stephens TJ Stephens is offline
 

Advanced Member
  
Join Date: May 2005
Location: California
Posts: 94
 

Default

sbtiti,

Go to your general settings and make sure "When a customer isn't logged in, it is presumed that he is from the default country.:" is unchecked. That should keep you from gettin the error.

T.J.
__________________
X-Cart Pro 4.1.11 (Live)
XRMA
XAFF
XAOM
DSEFU Pro
XGift Reg
Firetank Feed Manager
BCSE Shipping Calculator
XcartMod Dynamic Images
Reply With Quote
  #139  
Old 08-24-2005, 08:39 AM
 
TJ Stephens TJ Stephens is offline
 

Advanced Member
  
Join Date: May 2005
Location: California
Posts: 94
 

Default

For this module to work properly with other defined shipping methods I had to make one small change. This is the fix to the problem I was having in my May 31, 2005 post where the "Select a Carrier" drop down box was disappearing after I selected "Other Carriers":

Go to skin1/customer/main/cart_totals.tpl

Find:

Code:
{* $Id: cart_totals.tpl,v 1.67.2.10 2005/03/14 13:03:32 mclap Exp $ *} <DIV align="right"> {if $config.Shipping.disable_shipping ne "Y"} {if $login ne "" or $config.General.apply_default_country eq "Y" or $cart.shipping_cost gt 0}

Change To:

Code:
{* $Id: cart_totals.tpl,v 1.67.2.10 2005/03/14 13:03:32 mclap Exp $ *} <DIV align="right"> {if $config.Shipping.disable_shipping ne "Y"} {if $login ne "" or $config.General.apply_default_country eq "Y" or $cart.shipping_cost gt 0 or $estimate eq "NO"}
__________________
X-Cart Pro 4.1.11 (Live)
XRMA
XAFF
XAOM
DSEFU Pro
XGift Reg
Firetank Feed Manager
BCSE Shipping Calculator
XcartMod Dynamic Images
Reply With Quote
  #140  
Old 08-24-2005, 09:45 AM
 
sbtiti sbtiti is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 32
 

Default

Thank you. That fixed the problems we were having, but I found another problem. In the "Select a carrier" there are only the options for UPS and "Other carriers". But in the adminCP we have fedex options enabled under shipping methods. Why and/or how do I get it so that the FedEx option appears as well?

Is there a field I need to fill in somewhere in the adminCP?

Any help would be appreciated. Thank you!
__________________
Version 4.0.9
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 09:44 AM.

   

 
X-Cart forums © 2001-2020