| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Pre-Login Shipping Calculator | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#81
|
|||||||||
|
|||||||||
![]() In skin1/main/customer/cart_totals.tpl look for this code:
Code:
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:
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
__________________
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! |
|||||||||
#82
|
|||||||
|
|||||||
![]() In skin1/main/customer/cart_totals.tpl I located this code:
Code:
I added Code:
Code:
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? |
|||||||
#83
|
|||||||
|
|||||||
![]() 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.
__________________
Thanks, Phil X-Cart Gold Version 4.4.5 |
|||||||
#84
|
|||||||
|
|||||||
![]() Phil,
your solution works great. Thanks for the work!! Quote:
__________________
Using Version 3.5.4 |
|||||||
#85
|
|||||||
|
|||||||
![]() I have this working in 4.0.8, and want to have it display the ZIP code that the customer entered. Any ideas?
|
|||||||
#86
|
|||||||||
|
|||||||||
![]() 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
__________________
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! |
|||||||||
#87
|
|||||||
|
|||||||
![]() 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:
|
|||||||
#88
|
|||||||
|
|||||||
![]() Quote:
I did the same for pre-login shipping and tax for florida, it works great
__________________
Core version: 5.3.2.7 PHP: 5.6.29 MySQL server: 5.5.5-10.0.27-MariaDB-cll-lve (InnoDB engine support enabled) Web server: Apache Operating system: Linux XML parser: found GDLib: found (0) Translation driver: Database Curl version: 7.29.0 |
|||||||
#89
|
|||||||
|
|||||||
![]() 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 |
|||||||
#90
|
|||||||||
|
|||||||||
![]() I would hope they would post it here for all of us.
![]() Louise
__________________
Louise Studio 57 Designs - X-Cart Customization Providing X-Cart Services since 2004 Hottest Blog Directory - Submit Your Blog for a Free Listing |
|||||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|