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
  #201  
Old 06-25-2007, 03:51 AM
 
dem dem is offline
 

Member
  
Join Date: Aug 2003
Posts: 22
 

Default Re: Pre-Login Shipping Calculator

Quote:
Originally Posted by g0t0pless
Did I miss the answer for this? I, too, am running 4.1.7 and would like to have this option added.

Thanks

The process from post #197 above worked for me.
__________________
Dean Mayes
http://www.alabu.com
x-cart v4.1.9 [unix]
PHP 5.2.5
MySQL 5.0.22
New York, USA
Reply With Quote
  #202  
Old 06-28-2007, 05:09 PM
 
jeanne jeanne is offline
 

Advanced Member
  
Join Date: Aug 2004
Posts: 85
 

Default Re: Pre-Login Shipping Calculator

I'm working on a 4.1.8 site using Fast Lane Checkout and user defined shipping rates. All my shipping rates and taxes are set by zipcode only. No states.

In cart.php right after
x_session_register("ga_track_commerce");

add this:
Code:
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" || $country_estimate == "GB") && 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; $config["General"]["default_state"] = ""; $smarty->assign("estimate","NO"); } $smarty->assign("zipcode_estimate",$zipcode_estimate);

In /skin1/modules/Fast_Lane_Checkout/cart_subtotal.tpl right after

{$cart.applied_giftcerts[gc].giftcert_id} <a href="cart.php?mode=unset_gc&gcid={$cart.applied_g iftcerts[gc].giftcert_id}"><img src="{$ImagesDir}/clear.gif" width="11" height="11" border="0" valign="top" alt="{$lng.lbl_unset_gc|escape}" /></a> : <font class="ProductPriceSmall">{include file="currency.tpl" value=$cart.applied_giftcerts[gc].giftcert_cost}</font><br />
{/section}
{/if}

add
Code:
{* BCSE Begin *} {if $login} {else} {if $estimate ne "NO"} <br> <BR>Zip Code: <input type=TEXT name='zip_estimate' size=6 maxlength=6>&nbsp;&nbsp; <select name='country_estimate'> <option value="US">United States</option> <option value="CA">Canada</option> <option value="GB">United Kingdom</option> </select>&nbsp;&nbsp; {include file="buttons/button.tpl" button_title="Calculate Shipping" href="javascript: document.cartform.submit()" js_to_href="Y"} <br> {$lng.txt_order_total_msg} {else} <p>Current zip code: {$zipcode_estimate} <a href="cart.php?zip_estimate=clear">Click here to change your zip code</a> {/if} <BR><BR> {/if} {* BCSE End *} {if $login ne "" || $config.General.apply_default_country eq "Y" || $cart.shipping_cost gt 0 || $estimate eq "NO"} {foreach from=$shipping item=s} <table cellpadding="1" cellspacing="0" width="50%"{cycle values=" class='TableSubHead', "}> <tr> <td align="right"><label for="shippingid{$s.shippingid}">{$s.shipping|trademark:$insert_trademark}{if $s.shipping_time ne ""} - {$s.shipping_time}{/if}{if $config.Appearance.display_shipping_cost eq "Y" and ($login ne "" or $config.General.apply_default_country eq "Y" or $cart.shipping_cost gt 0)} ({include file="currency.tpl" value=$s.rate}){/if}</label></td> </tr> </table> {/foreach} <br /><br /> {/if}

It displays the costs for shipping but does not allow for a selection. I tried a bit but couldn't get it the selection to pass through to the rest of the checkout. Taxes show up also.

Jeanne
-------------
4.0.18 live store
4.1.8 in development
Reply With Quote
  #203  
Old 07-03-2007, 01:16 PM
  pig@pp's Avatar 
pig@pp pig@pp is offline
 

Advanced Member
  
Join Date: Mar 2006
Location: San Luis Obispo, CA
Posts: 38
 

Default Re: Pre-Login Shipping Calculator

Looking for a way to prevent taxes from being calculated until the user logs in. Using x-cart 4.0.2
__________________
http://www.polyperformance.com/
4.1.9 Gold (x7)
Hosting by EWDHosting.com
Reply With Quote
  #204  
Old 07-06-2007, 01:24 PM
 
Kishy Kishy is offline
 

Advanced Member
  
Join Date: Jul 2006
Posts: 39
 

Default One Modification?

That is an awesome add on! I tested it on your site and it works and looks great! One modification request: if you add an item that has free shipping then add another that does not, it still calculates them both as free shipping. Is there a way around this or how are you working this out?
__________________
Kishy
xcart@generalgraphic.com
X-Cart Version 4.1.2 [Linux]
Reply With Quote
  #205  
Old 07-16-2007, 12:57 PM
  thehoneyjarhomedotcom's Avatar 
thehoneyjarhomedotcom thehoneyjarhomedotcom is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 32
 

Default Re: Pre-Login Shipping Calculator

Is this available for 4.1.8 yet? Anybody implemented it? Also does this only work with real time shipping rates or does it work with user defined rates as well?

Thanks.
__________________
Kyle K.
The Honey Jar- Because Home Is Where Your Honey Is
www.thehoneyjarhome.com
x-cart gold v4.1.8
Reply With Quote
  #206  
Old 07-29-2007, 06:29 PM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default Re: Pre-Login Shipping Calculator

WARNING: I am not a programmer and I only tested this on my soon to be live 4.1.8 test store. But it is goooooood....

That Being said....

Pre-Login Shipping Calculator for X-Cart 4.1.8 With Fast Lane Checkout


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("anonymous_checkout"); x_session_register("payment_cc_fields"); x_session_register("current_carrier","UPS");

Insert:

Code:
#SHIPPING CALCULATOR 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"); } $intershipper_recalc = "Y"; #SHIPPING CALCULATOR

Copy the entire contents of skin1/customer/main/cart_totals.tpl

Highlight the entire contents of skin1/modules/Fast_Lane_Checkout/cart_subtotal.tpl and paste the contents of cart_totals.tpl over it.

(The contents of cart_subtotal.tpl is merely a stripped out version of cart_totals.tpl taking out the very thing we all want)


Now in the newly completely changed skin1/modules/Fast_Lane_Checkout/cart_subtotal.tpl place:

Code:
{* BCSE Begin *} {if $login} {else} {if $estimate ne "NO"} <br><b>Enter your zip code below to calculate shipping charges.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b><p><b>Enter Zip Code&nbsp;</b> <input type=TEXT name='zip_estimate' size=5 maxlength=5>&nbsp;&nbsp; {include file="buttons/button.tpl" button_title="Click Here To Calculate Shipping" href="javascript: document.cartform.submit()" js_to_href="Y"}&nbsp; {else} <p><a href="cart.php?zip_estimate=clear">Click here to change your zip code</a> ({$userinfo.s_zipcode}) {/if} <BR><BR> {/if} {* BCSE End *}

Just before:

Code:
{if $not_logged_message eq "1"} {$lng.txt_order_total_msg}{/if}

Finally, in languages, make a label "lbl_calc_title". It should say something like this "Order - Shipping Calculator"

In skin1/modules/Fast_Lane_Checkout/cart_subtotal.tpl find all occurences (3) of {$lng.lbl_delivery} and replace them with {$lng.lbl_calc_title}

If customer is logged in, Taxes will show on the cart/calculator page and this mod appears to not affect the checkout process at all.

YOUR DONE!!!!
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote
  #207  
Old 07-30-2007, 12:56 PM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default Re: Pre-Login Shipping Calculator

Well... I tested this 6 ways to Sunday and I can't find a problem... Anyone have any thoughts or have found a problem with my version?
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote
  #208  
Old 07-31-2007, 11:12 AM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default Re: Pre-Login Shipping Calculator

I went live with the 4.1.8 upgrade and everything seems to work fine with regards to the Pre-Login Shipping Calculator. One thing I wish i could figure out, is how to get the last selected shipping method in the calculator to carry over to the checkout page, if checkout is selected.

Any ideas???
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote
  #209  
Old 08-03-2007, 06:22 AM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default Re: Pre-Login Shipping Calculator

Quote:
Originally Posted by DogByteMan
One thing I wish i could figure out, is how to get the last selected shipping method in the calculator to carry over to the checkout page, if checkout is selected.

Any ideas???

Anybody????
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote
  #210  
Old 08-03-2007, 06:30 AM
  thehoneyjarhomedotcom's Avatar 
thehoneyjarhomedotcom thehoneyjarhomedotcom is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 32
 

Default Re: Pre-Login Shipping Calculator

I don't have any ideas. I'm focussing on other things right now. Good luck.
__________________
Kyle K.
The Honey Jar- Because Home Is Where Your Honey Is
www.thehoneyjarhome.com
x-cart gold v4.1.8
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 10:56 PM.

   

 
X-Cart forums © 2001-2020