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
  #91  
Old 12-20-2004, 05:18 PM
  BCSE's Avatar 
BCSE BCSE is offline
 

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

Default

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
__________________
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
  #92  
Old 01-14-2005, 10:09 AM
 
halestorm halestorm is offline
 

Advanced Member
  
Join Date: Oct 2004
Posts: 44
 

Default

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?
__________________
...
x-cart-4.0.11

http://www.thegamegeek.net
Reply With Quote
  #93  
Old 03-02-2005, 09:09 PM
  Jayk's Avatar 
Jayk Jayk is offline
 

eXpert
  
Join Date: Nov 2003
Location: Calgary, Alberta, Canada
Posts: 333
 

Default

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
__________________
X-Cart Gold 4.4.3
Blog: www.flashinthepan.ca
Reply With Quote
  #94  
Old 03-03-2005, 04:40 AM
 
chilll33 chilll33 is offline
 

Senior Member
  
Join Date: Oct 2003
Location: Miami, FL
Posts: 100
 

Default

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


Works for me
__________________
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
Reply With Quote
  #95  
Old 03-03-2005, 09:14 AM
  Jayk's Avatar 
Jayk Jayk is offline
 

eXpert
  
Join Date: Nov 2003
Location: Calgary, Alberta, Canada
Posts: 333
 

Default

Thanks for the reply. I'll give it a shot then.

Jason
__________________
X-Cart Gold 4.4.3
Blog: www.flashinthepan.ca
Reply With Quote
  #96  
Old 03-04-2005, 05:27 PM
  Jayk's Avatar 
Jayk Jayk is offline
 

eXpert
  
Join Date: Nov 2003
Location: Calgary, Alberta, Canada
Posts: 333
 

Default

Just installed the mod on 4.0.12 Gold and it works like a dream.

Thanks,

Jason
__________________
X-Cart Gold 4.4.3
Blog: www.flashinthepan.ca
Reply With Quote
  #97  
Old 03-11-2005, 05:42 AM
 
Sonia Sonia is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 72
 

Default

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 )
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:
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

Anyone know what that means? Is there a setting somewhere I've missed?

Holy smokes this stuff seems so complicated!!!

Sonia
__________________
Sonia

www.vidaville.com
Xcart Gold 4.0.16
platform - Windows
Reply With Quote
  #98  
Old 03-11-2005, 03:24 PM
  KCAutosound's Avatar 
KCAutosound KCAutosound is offline
 

eXpert
  
Join Date: Feb 2005
Posts: 220
 

Default

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.
__________________
X-Cart version 4.7.6 Gold
xcartmods.co.uk - Ultra Template
Reply With Quote
  #99  
Old 03-17-2005, 07:20 PM
 
micromedia micromedia is offline
 

Member
  
Join Date: Feb 2005
Posts: 27
 

Default

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 *} {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 *}


But I have to add my available country
on this code:
Code:
<select name='country_estimate'> <option value="US">United States</OPTION> <option value="CA">Canada</OPTION> <OPTION value="AF">Afghanistan</OPTION> <OPTION value="AL">Albania</OPTION> <OPTION value="DZ">Algeria</OPTION> <OPTION value="AS">American Samoa</OPTION> <OPTION value="AD">Andorra</OPTION> <OPTION value="AO">Angola</OPTION> <OPTION value="AI">Anguilla</OPTION> <OPTION value="AQ">Antarctica</OPTION> <OPTION value="AG">Antigua and Barbuda</OPTION> <OPTION value="AR">Argentina</OPTION> <OPTION value="AM">Armenia</OPTION> <OPTION value="AW">Aruba</OPTION> <OPTION value="AU">Australia</OPTION> <OPTION value="AT">Austria</OPTION> <OPTION value="AZ">Azerbaijan</OPTION> <OPTION value="BS">Bahamas</OPTION> <OPTION value="BH">Bahrain</OPTION> <OPTION value="BD">Bangladesh</OPTION> <OPTION value="BB">Barbados</OPTION> <OPTION value="BY">Belarus</OPTION> <OPTION value="BE">Belgium</OPTION> <OPTION value="BZ">Belize</OPTION> <OPTION value="BJ">Benin</OPTION> <OPTION value="BM">Bermuda</OPTION> <OPTION value="BT">Bhutan</OPTION> <OPTION value="BO">Bolivia</OPTION> <OPTION value="BA">Bosnia and Herzegowina</OPTION> <OPTION value="BW">Botswana</OPTION> <OPTION value="BV">Bouvet Island</OPTION> <OPTION value="BR">Brazil</OPTION> <OPTION value="IO">British Indian Ocean Territory</OPTION> <OPTION value="VG">British Virgin Islands</OPTION> <OPTION value="BN">Brunei Darussalam</OPTION> <OPTION value="BG">Bulgaria</OPTION> <OPTION value="BF">Burkina Faso</OPTION> <OPTION value="BI">Burundi</OPTION> <OPTION value="KH">Cambodia</OPTION> <OPTION value="CM">Cameroon</OPTION> <OPTION value="CA">Canada</OPTION> <OPTION value="CV">Cape Verde</OPTION> <OPTION value="KY">Cayman Islands</OPTION> <OPTION value="CF">Central African Republic</OPTION> <OPTION value="TD">Chad</OPTION> <OPTION value="CL">Chile</OPTION> <OPTION value="CN">China</OPTION> <OPTION value="CX">Christmas Island</OPTION> <OPTION value="CC">Cocos (Keeling) Islands</OPTION> <OPTION value="CO">Colombia</OPTION> <OPTION value="KM">Comoros</OPTION> <OPTION value="CG">Congo</OPTION> <OPTION value="CK">Cook Islands</OPTION> <OPTION value="CR">Costa Rica</OPTION> <OPTION value="CI">Cote D'ivoire</OPTION> <OPTION value="HR">Croatia</OPTION> <OPTION value="CU">Cuba</OPTION> <OPTION value="CY">Cyprus</OPTION> <OPTION value="CZ">Czech Republic</OPTION> <OPTION value="DK">Denmark</OPTION> <OPTION value="DJ">Djibouti</OPTION> <OPTION value="DM">Dominica</OPTION> <OPTION value="DO">Dominican Republic</OPTION> <OPTION value="TP">East Timor</OPTION> <OPTION value="EC">Ecuador</OPTION> <OPTION value="EG">Egypt</OPTION> <OPTION value="SV">El Salvador</OPTION> <OPTION value="GQ">Equatorial Guinea</OPTION> <OPTION value="ER">Eritrea</OPTION> <OPTION value="EE">Estonia</OPTION> <OPTION value="ET">Ethiopia</OPTION> <OPTION value="FK">Falkland Islands (Malvinas)</OPTION> <OPTION value="FO">Faroe Islands</OPTION> <OPTION value="FJ">Fiji</OPTION> <OPTION value="FI">Finland</OPTION> <OPTION value="FR">France</OPTION> <OPTION value="FX">France, Metropolitan</OPTION> <OPTION value="GF">French Guiana</OPTION> <OPTION value="PF">French Polynesia</OPTION> <OPTION value="TF">French Southern Territories</OPTION> <OPTION value="GA">Gabon</OPTION> <OPTION value="GM">Gambia</OPTION> <OPTION value="GE">Georgia</OPTION> <OPTION value="DE">Germany</OPTION> <OPTION value="GH">Ghana</OPTION> <OPTION value="GI">Gibraltar</OPTION> <OPTION value="GR">Greece</OPTION> <OPTION value="GL">Greenland</OPTION> <OPTION value="GD">Grenada</OPTION> <OPTION value="GP">Guadeloupe</OPTION> <OPTION value="GU">Guam</OPTION> <OPTION value="GT">Guatemala</OPTION> <OPTION value="GN">Guinea</OPTION> <OPTION value="GW">Guinea-Bissau</OPTION> <OPTION value="GY">Guyana</OPTION> <OPTION value="HT">Haiti</OPTION> <OPTION value="HM">Heard and McDonald Islands</OPTION> <OPTION value="HN">Honduras</OPTION> <OPTION value="HK">Hong Kong</OPTION> <OPTION value="HU">Hungary</OPTION> <OPTION value="IS">Iceland</OPTION> <OPTION value="IN">India</OPTION> <OPTION value="ID">Indonesia</OPTION> <OPTION value="IQ">Iraq</OPTION> <OPTION value="IE">Ireland</OPTION> <OPTION value="IR">Islamic Republic of Iran</OPTION> <OPTION value="IL">Israel</OPTION> <OPTION value="IT">Italy</OPTION> <OPTION value="JM">Jamaica</OPTION> <OPTION value="JP">Japan</OPTION> <OPTION value="JO">Jordan</OPTION> <OPTION value="KZ">Kazakhstan</OPTION> <OPTION value="KE">Kenya</OPTION> <OPTION value="KI">Kiribati</OPTION> <OPTION value="KP">Korea</OPTION> <OPTION value="KR">Korea, Republic of</OPTION> <OPTION value="KW">Kuwait</OPTION> <OPTION value="KG">Kyrgyzstan</OPTION> <OPTION value="LA">Laos</OPTION> <OPTION value="LV">Latvia</OPTION> <OPTION value="LB">Lebanon</OPTION> <OPTION value="LS">Lesotho</OPTION> <OPTION value="LR">Liberia</OPTION> <OPTION value="LY">Libyan Arab Jamahiriya</OPTION> <OPTION value="LI">Liechtenstein</OPTION> <OPTION value="LT">Lithuania</OPTION> <OPTION value="LU">Luxembourg</OPTION> <OPTION value="MO">Macau</OPTION> <OPTION value="MK">Macedonia</OPTION> <OPTION value="MG">Madagascar</OPTION> <OPTION value="MW">Malawi</OPTION> <OPTION value="MY">Malaysia</OPTION> <OPTION value="MV">Maldives</OPTION> <OPTION value="ML">Mali</OPTION> <OPTION value="MT">Malta</OPTION> <OPTION value="MH">Marshall Islands</OPTION> <OPTION value="MQ">Martinique</OPTION> <OPTION value="MR">Mauritania</OPTION> <OPTION value="MU">Mauritius</OPTION> <OPTION value="YT">Mayotte</OPTION> <OPTION value="MX">Mexico</OPTION> <OPTION value="FM">Micronesia</OPTION> <OPTION value="MD">Moldova, Republic of</OPTION> <OPTION value="MC">Monaco</OPTION> <OPTION value="MN">Mongolia</OPTION> <OPTION value="MS">Montserrat</OPTION> <OPTION value="MA">Morocco</OPTION> <OPTION value="MZ">Mozambique</OPTION> <OPTION value="MM">Myanmar</OPTION> <OPTION value="NA">Namibia</OPTION> <OPTION value="NR">Nauru</OPTION> <OPTION value="NP">Nepal</OPTION> <OPTION value="NL">Netherlands</OPTION> <OPTION value="AN">Netherlands Antilles</OPTION> <OPTION value="NC">New Caledonia</OPTION> <OPTION value="NZ">New Zealand</OPTION> <OPTION value="NI">Nicaragua</OPTION> <OPTION value="NE">Niger</OPTION> <OPTION value="NG">Nigeria</OPTION> <OPTION value="NU">Niue</OPTION> <OPTION value="NF">Norfolk Island</OPTION> <OPTION value="MP">Northern Mariana Islands</OPTION> <OPTION value="NO">Norway</OPTION> <OPTION value="OM">Oman</OPTION> <OPTION value="PK">Pakistan</OPTION> <OPTION value="PW">Palau</OPTION> <OPTION value="PA">Panama</OPTION> <OPTION value="PG">Papua New Guinea</OPTION> <OPTION value="PY">Paraguay</OPTION> <OPTION value="PE">Peru</OPTION> <OPTION value="PH">Philippines</OPTION> <OPTION value="PN">Pitcairn</OPTION> <OPTION value="PL">Poland</OPTION> <OPTION value="PT">Portugal</OPTION> <OPTION value="PR">Puerto Rico</OPTION> <OPTION value="QA">Qatar</OPTION> <OPTION value="RE">Reunion</OPTION> <OPTION value="RO">Romania</OPTION> <OPTION value="RU">Russian Federation</OPTION> <OPTION value="RW">Rwanda</OPTION> <OPTION value="LC">Saint Lucia</OPTION> <OPTION value="WS">Samoa</OPTION> <OPTION value="SM">San Marino</OPTION> <OPTION value="ST">Sao Tome and Principe</OPTION> <OPTION value="SA">Saudi Arabia</OPTION> <OPTION value="SN">Senegal</OPTION> <OPTION value="SC">Seychelles</OPTION> <OPTION value="SL">Sierra Leone</OPTION> <OPTION value="SG">Singapore</OPTION> <OPTION value="SK">Slovakia</OPTION> <OPTION value="SI">Slovenia</OPTION> <OPTION value="SB">Solomon Islands</OPTION> <OPTION value="SO">Somalia</OPTION> <OPTION value="ZA">South Africa</OPTION> <OPTION value="ES">Spain</OPTION> <OPTION value="LK">Sri Lanka</OPTION> <OPTION value="SH">St. Helena</OPTION> <OPTION value="KN">St. Kitts and Nevis</OPTION> <OPTION value="PM">St. Pierre and Miquelon</OPTION> <OPTION value="VC">St. Vincent and the Grenadines</OPTION> <OPTION value="SD">Sudan</OPTION> <OPTION value="SR">Suriname</OPTION> <OPTION value="SJ">Svalbard and Jan Mayen Islands</OPTION> <OPTION value="SZ">Swaziland</OPTION> <OPTION value="SE">Sweden</OPTION> <OPTION value="CH">Switzerland</OPTION> <OPTION value="SY">Syrian Arab Republic</OPTION> <OPTION value="TW">Taiwan</OPTION> <OPTION value="TJ">Tajikistan</OPTION> <OPTION value="TZ">Tanzania, United Republic of</OPTION> <OPTION value="TH">Thailand</OPTION> <OPTION value="TG">Togo</OPTION> <OPTION value="TK">Tokelau</OPTION> <OPTION value="TO">Tonga</OPTION> <OPTION value="TT">Trinidad and Tobago</OPTION> <OPTION value="TN">Tunisia</OPTION> <OPTION value="TR">Turkey</OPTION> <OPTION value="TM">Turkmenistan</OPTION> <OPTION value="TC">Turks and Caicos Islands</OPTION> <OPTION value="TV">Tuvalu</OPTION> <OPTION value="UG">Uganda</OPTION> <OPTION value="UA">Ukraine</OPTION> <OPTION value="AE">United Arab Emirates</OPTION> <OPTION value="GB">United Kingdom (Great Britain)</OPTION> <OPTION value="US"selected>United States</OPTION> <OPTION value="VI">United States Virgin Islands</OPTION> <OPTION value="UY">Uruguay</OPTION> <OPTION value="UZ">Uzbekistan</OPTION> <OPTION value="VU">Vanuatu</OPTION> <OPTION value="VA">Vatican City State</OPTION> <OPTION value="VE">Venezuela</OPTION> <OPTION value="VN">Viet Nam</OPTION> <OPTION value="WF">Wallis And Futuna Islands</OPTION> <OPTION value="EH">Western Sahara</OPTION> <OPTION value="YE">Yemen</OPTION> <OPTION value="YU">Yugoslavia</OPTION> <OPTION value="ZR">Zaire</OPTION> <OPTION value="ZM">Zambia</OPTION> <OPTION value="ZW">Zimbabwe</OPTION> </select>
etc.

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

__________________
X Cart Gold Ver. 4.1.6
Reply With Quote
  #100  
Old 03-17-2005, 08:49 PM
 
g0t0pless g0t0pless is offline
 

eXpert
  
Join Date: Jul 2003
Posts: 360
 

Default

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.
__________________
4.1.7
X-Cart Gold
Product Configurator Module
Advanced Order Management Module
RMA Module
Feature Compare Module
Blue Dream theme by 7Dana.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 12:54 PM.

   

 
X-Cart forums © 2001-2020