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
  #71  
Old 09-23-2004, 03:12 PM
 
inksticks inksticks is offline
 

Advanced Member
  
Join Date: Aug 2004
Posts: 34
 

Default 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.
__________________
X-Cart 4.0.5
http://www.inksticks.com/
Reply With Quote
  #72  
Old 09-23-2004, 03:42 PM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,066
 

Default

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
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #73  
Old 09-23-2004, 04:14 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

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.
Reply With Quote
  #74  
Old 09-23-2004, 08:29 PM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,066
 

Default

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"); 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 zip/postal code to calculate shipping charges. <select name='country_estimate'> <option value="US">United States <option value="CA">Canada </select> <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 *}

You owe me a beer if this works adpboss

Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #75  
Old 09-24-2004, 05:34 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Will test today. Cheers.
Reply With Quote
  #76  
Old 09-24-2004, 01:39 PM
 
inksticks inksticks is offline
 

Advanced Member
  
Join Date: Aug 2004
Posts: 34
 

Default Problem half resolved

Quote:
Originally Posted by BCSE
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

"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.
__________________
X-Cart 4.0.5
http://www.inksticks.com/
Reply With Quote
  #77  
Old 09-24-2004, 02:05 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Couldn't you do something in the tpl like if

Code:
{if $order.shipping_cost eq "0.00"} N/A {else} {$order.shipping_cost} {/if}

I just made up the shipping cost varible, I am not sure what it is.
Reply With Quote
  #78  
Old 09-25-2004, 01:16 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

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:
Canada Post Realtime shipping rate calculation service returned the following error:
XML parsing error.
Sorry, there are no available shipping methods for your location.:
anonymous
Modify

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:
Canada Post Realtime shipping rate calculation service returned the following error:
Destination Postal Code/State Name/ Country is illegal.
Sorry, there are no available shipping methods for your location.:
anonymous
Modify
Reply With Quote
  #79  
Old 09-25-2004, 05:48 PM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,066
 

Default

adpboss,

Great! Glad it works! \

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
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #80  
Old 09-26-2004, 08:32 AM
 
inksticks inksticks is offline
 

Advanced Member
  
Join Date: Aug 2004
Posts: 34
 

Default free shipping problem

Quote:
Originally Posted by adpboss
Couldn't you do something in the tpl like if

Code:
{if $order.shipping_cost eq "0.00"} N/A {else} {$order.shipping_cost} {/if}

I just made up the shipping cost varible, I am not sure what it is.

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.
__________________
X-Cart 4.0.5
http://www.inksticks.com/
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 07:10 AM.

   

 
X-Cart forums © 2001-2020