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 |
My first long post on page 5 dated "Thu Sep 23, 2004 1:36 pm" is all the code and steps I used for version 4.0.4 that has been since upgraded to I believe 4.0.7 and it works in there too.
Carrie |
ok so I used the code in
http://forum.x-cart.com/viewtopic.php?p=59671#59671 and so far it seems to work. I'm in 4.8 Just one other thing... On the page right about where it asks for the zip code, it says, "Please log in to see shipping rates.: anonymous" How can I remove that? |
Has anyone tried this mod with 4.0.12?
I might give it a try anyway, but I've only got a live shop, no test server. Thanks, Jason |
Quote:
Works for me |
Thanks for the reply. I'll give it a shot then.
Jason |
Just installed the mod on 4.0.12 Gold and it works like a dream.
Thanks, Jason |
Hey people! This looks like a great Mod, but I'm running into a glitch. BCSE came up with this mod for Canada shipping calculations (A big thanks, Carrie and everyone else who take the time to share mods) ...
http://forum.x-cart.com/viewtopic.php?p=59711#59711 I'm using Canada Post for now. When I change the country to Canada, the drop down menu for shipping rates changes to International. When I type in a postal code, that menu changes to US shipping rates. I'm confused. I'm assuming it's something to do with the Cart.php code, but I'm not familiar enough with PHP to know what to change. Here's a link to a product on my website for you to test the shipping calculator on (site's not live yet - soon, very soon...I hope :wink: ) http://www.vidaville.com/store/product.php?productid=16291&cat=320&page=1 Help anyone? Carrie? adpboss, did you get this working? Edit: Okay, I got it so the Canadian Shipping rate is calculated. But now when I put in a US postal Code it says: Quote:
Anyone know what that means? Is there a setting somewhere I've missed? Holy smokes this stuff seems so complicated!!! :x Sonia |
Hey guys I'm running version 4.0.12 Could someone PM me the code for this. The code seems to be spread out over 7 pages.
|
Hi,
This is good mod . Thank you very much. I am running on 4.0.11. it is working fine. I am selling Out of United states and other countries. Some Country I will not ship. And I am using UPS. I am using this code: Code:
{* BCSE Begin *} But I have to add my available country on this code: Code:
<select name='country_estimate'> How can I change this code with my available country? When I disable country on my admin page I want to change automatickly this <option> line . IS it possible? Thanks... Quote:
|
Awesome!
Now, quick question. Lets see if we can expand on this mod slightly. I would like a "calculate shipping" button on each item's description, preferably near the price somewhere. Or better yet, right above or below the "add to cart" button. |
One other thing that has come up with this mod...
If you have a value in Shipping freight ($) it is not added to the shipping amount shown but is added at checkout. This confuses the customer. Anyone know how we could add whatever value that is in Shipping freight ($) to the pre-login shipping calculation? |
I like to have this feature on my site. But I use "Defined shipping methods" ( I define shipping rate by zones) plus "FedEx Priority". I have fedex rate sheet downloaded.
I cannot use the code posted in this thread. Does this code work with UPS only? I am not sure how zipcode lookup is done in my case. I define zones by states only but I have FedEx rate sheet with zipcode. Can someone edit posted code so that it works for my case? I do not need a fancy zipcode lookup. All I need is the code that will lookup the state entered or zone entered and calculate the shipping according to defined shipping rate. S-H-W-E-K-H-A-W |
Just had to say thank you to rack-it for the original concept and Carrie for the 4.x series code modifications. 8)
I just installed this for a client's shop as well as my Mom's shop over the weekend. Needless to say both are extremely pleased with this addition. :) Thank you rack-it and Carrie. Note to Carrie: someone is on their way over to get your reward points mod - you'll know them when you see it 8) |
works great on 3.5.14, thanks!
|
How many beers you want? It just worked for me.
Thanks a million. I didn't break anything I found yet LOL Delores |
I spoke too soon. I broke my check box if the shiping address is the same as billing address. I'll buy the beer anyway LOL
Delores |
Can the /admin/main/test_shippings.tpl be modified or implemented to work like/with this mod?
I like the idea of using the x-cart enabled countries to check for rates. |
Was wondering if it would be possible for the shipping calculator to show up on the product page, so shipping can be estimated BEFORe having to place it in the cart?
|
Woah, it's been a while since I last checked this thread. EIGHT pages now, amazing!
|
Upgraded from 4.0.12 to 4.0.13 and re-did the mod. Although it worked beautifully for 4.0.12, it broke on 4.0.13.
Jason |
This is a great mod thanks to all who contributed.
=D> =D> I've added the shipping part of this mod into 4.0.13 but wanted to also include the taxes can someone please provide some guidence as to where to place the taxes code in cart.php and/or cart_total.tpl Thanks again. |
Quote:
We also use DEFINED SHIPPING Rates that are state and country specific, we were very much hoping we could use this mod with our setup. It seems everyone else here is using it for the REAL TIME SHIPPING but what about those of us who do not use real time? We would also be interested in Tax calculations as well, so our client knows exactly what they are paying before they go any further into the checkout process. BTW we are running 4.0.13 If anyone can help with this, we would be more then happy to compensate you for your time :) |
This is a great mod! It should be integrated into future versions of x-cart. Thanks Rackit and all that contributed. I have the code posted by BCSE on page five working on 4.0.13 along with the tax modification posted by sportruck but I cannot figure out how to fix one problem.
I currently ship with UPS using realtime shipping costs. I also have defined another shipping option named "Customer Pick Up" so customers can pick the items up from our store without paying for shipping. When a customer first comes to the site and inputs their zip code it displays UPS in the "select a carrier" box and the realtime shipping costs for the UPS delivery methods I have set up. That works great. If I select "Other Carriers", then it will show the defined shipping method "Customer Pick Up" that I created and the shipping cost will display n/a. That works great too. However, once I select "Other Carriers" it will not let me go back to UPS. The "select a carrier" box disappears and only my "Customer Pick Up" option is displayed in the delivery box. Does anyone know what is causing this? Interestingly, if I click on "Click here to change your zip code" it will display the UPS otions in the delivery box along with my customer pick up option but it does not show the realtime rates. I hope this makes sense. Any help would be appreciated. |
taxes & defined rates 4.0.13
I use 4.0.13 with this mod and it works fine.
Right now I have Defined Shipping Rates and it works with them as well. The taxes show up correctly on cart.php. Define your tax zones by zip code and make sure that you do not have Default ZipCode (in General Settings) that would cause tax to be applied. I have it blank. |
Re: taxes & defined rates 4.0.13
Quote:
Code:
if($zipcode_estimate >= 10002 && $zipcode_estimate <= 14925){ thx |
I don't have code like that in cart.php. The code is already set up to do this if your tax zone is set up by zip code.
I have my destination zone (that I use for taxing) set up by zip code like this: 90% 91% 92% 93% 94% 95% 960% 961% This mod is basically giving a temporary value to the 'Default Zip Code' entry that you can set in General Settings. So when an zip code entry is put in the shipping calculator that matches my tax zone, the tax shows up as long as the 'Default Zip Code' entry in General Settings blank. If you have any other of the default settings (zip code, state) filled in clear the entries to see if that makes a difference. |
Quote:
I 'm not sure how and where you got % in there. I remove the zipcode and city in general settings but no luck, I tried to remove the state but there is no blank option. The assign shipping is displayed in the shipping label e.g. Sales Tax 8.625%: n/a or Sales Tax 9.50%: n/a but the calculation is not made 'n/a' is always displayed. for some reason its not being allow to change 'n/a' to display calulated taxes. :( Here is a look at my cart.php maybe you can see something that I couldn't. Code:
# Thanks for the help! :) |
90%
91% 92% 93% 94% 95% 960% 961% is how I have my destination zone that I use for taxes set up. It is not in the code. It's under Inventory-> Destination Zones I am taxing orders to all Zip Codes in California so when you enter a zip code that matches (% are the wild cards in this set up) the tax shows up. How do you have your taxing zone set up? Does it check by zip code, state, city ???? |
Quote:
Quote:
Thanks |
Jedak,
I think I am having the same problem as you. Try going to "taxing system" under management and uncheck "Display cart/order totals including tax:". See if this makes it display the taxes. I'm using 4.0.13 too and if this box is checked then it displays takes for me with the pre-login shipping calculator. If I uncheck it (which I want to do for formating reasons) then the total still includes the taxes but the tax line displays "n/a" instead of the actual tax amount. Is this the same thing you are having trouble with? If so, I will let you know if I figure out how to fix this and please do the same if you find a fix. TJ |
All times are GMT -8. The time now is 04:17 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.