![]() |
In skin1/main/customer/cart_totals.tpl look for this code:
Code:
<TD nowrap align="right"><FONT class="ProductPriceSmall">{if $login ne "" or $config.General.apply_default_country eq "Y" or $cart.shipping_cost gt 0}{include file="currency.tpl" value=$shipping_cost}</FONT></TD> There you will see the n/a that shows up. You can change that to what ever you like. OR you can take out the: Code:
or $cart.shipping_cost gt 0 In the if, since you are having this problem with free shipping. It actually may be a bug and you may want to report it to X-cart via your help desk. Seems to me like shipping should show up as Zero if it's free, instead of n/a. Carrie |
In skin1/main/customer/cart_totals.tpl I located this code:
Code:
I added Code:
or $cart.shipping_cost eq 0 Code:
or $cart.shipping_cost gt 0 This fixed the n/a problem and now 0.00 is being shown instead of n/a but in the Delivery method: drop down list the prices of all methods still disappear when when free shipping is selected. This problem does not occur when a customer is logged in so I don't think it is a bug. There must be another place in the tpl that is causing this to happen. Any ideas? |
I finally managed to get this mod working clean in a 3.5.10 site. Here is what I did:
1). Uncheck the option "When a customer isn't logged in, it is presumed that he is from a default country." in General. 2). Create calculate.gif and place it in /skin1/images (you could just use the supplied go.gif). 3). Modified cart.php: Old 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"); New Code: if(!$login){ $smarty->assign("not_logged_message","1"); } else{ $smarty->assign("not_logged_message","0"); } 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("zipcode_estimate"); if($HTTP_GET_VARS['zip_estimate'] == "clear"){ $zipcode_estimate = ""; func_header_location("cart.php"); } if(!empty($HTTP_POST_VARS['zip_estimate'])){ $zipcode_estimate = $_POST['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 = "";} func_header_location("cart.php"); } if($zipcode_estimate != ""){ $config["General"]["apply_default_country"] = "Y"; $config["General"]["default_zipcode"] = $zipcode_estimate; $smarty->assign("estimate","NO"); } 4). Modified top.inc.php Old Code: if (!in_array($__key, array("HTTP_GET_VARS","HTTP_POST_VARS","HTTP_SERVE R_VARS","HTTP_ENV_VARS","HTTP_COOKIE_VARS","HTTP_P OST_FILES","__key","__val"))) New Code: if (!in_array($__key, array("HTTP_GET_VARS","HTTP_POST_VARS","HTTP_SERVE R_VARS","HTTP_ENV_VARS","HTTP_COOKIE_VARS","HTTP_P OST_FILES","__key","__val","_GET","_POST","_SERVER "))) 5). Modified cart_totals.tpl Added this code to the bottom of the file: <div align=right> {if $not_logged_message eq "1"} {if $estimate ne "NO"} Please enter your zip code to calculate shipping charges. <input type=TEXT name='zip_estimate' size=5 maxlength=5> <input type=image alt="Calculate Shipping" src="../skin1/images/calculate.gif" border=0 align=middle name=btnCalculate > {else} Click here to change your shipping zip code. {/if} {/if} If you use this method, make sure you back things up first! I am not a programmer, just a hacker. |
Phil,
your solution works great. Thanks for the work!! Quote:
|
I have this working in 4.0.8, and want to have it display the ZIP code that the customer entered. Any ideas?
|
Quote:
To display any php variable in smarty, you first have to tell php to make it available for smarty. So you would need $smarty->assign("zipcode_estimate",$zipcode_estimate); in cart.php (usually near the end of the file with the rest of the smarty assigns). That makes {$zipcode_estimate} available in the templates. HTH! Carrie |
Thank you. I had firgued out the session variables and was editing my original post before I saw your reply.
I also made it calculate tax based on ZIP code, but I hard coded it for CA tax. I'm sure there is a better way to do this, but this is my quick hack: Code:
if($zipcode_estimate >= 90001 && $zipcode_estimate <= 96162){ |
Quote:
I did the same for pre-login shipping and tax for florida, it works great |
I'm using 4.08. There is so much code on all these pages, I'm not sure where to begin. If anybody could just PM me from start to finish I would really appreciate it.
Thaks! Daniel |
I would hope they would post it here for all of us. ;-)
Louise |
All times are GMT -8. The time now is 11:39 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.