View Single Post
  #40  
Old 02-08-2005, 04:00 PM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default

Instructions for 4.0.x using the ezCheckout mod by jon:

In your skin1 folder create the following files

copybilling1.js
Code:
function InitSaveVariables_shipping(form){ s_firstname = form.s_firstname.value; s_lastname = form.s_lastname.value; s_address = form.s_address.value; s_address_2 = form.s_address_2.value; s_city = form.s_city.value; s_state = form.s_state.value; _s_state = document.getElementById('_s_state').value; s_country = form.s_country.value; s_zipcode = form.s_zipcode.value; } function copybilling(form){ if (form.copyb.checked){ InitSaveVariables_shipping(form); form.s_firstname.value = form.firstname.value; form.s_lastname.value = form.lastname.value; form.s_address.value = form.b_address.value; form.s_address_2.value = form.b_address_2.value; form.s_city.value = form.b_city.value; form.s_country.value = form.b_country.value; form.s_zipcode.value = form.b_zipcode.value; change_states(document.getElementById('s_country'), 's_state', 'State/Province', '', '', '', ''); form.s_state.value = form.b_state.value; document.getElementById('_s_state').value = document.getElementById('_b_state').value; } else { form.s_firstname.value = ""; form.s_lastname.value = ""; form.s_address.value = ""; form.s_address_2.value = ""; form.s_city.value = ""; form.s_country.value = form.b_country.value; form.s_zipcode.value = ""; change_states(document.getElementById('s_country'), 's_state', 'State/Province', '', '', '', ''); form.s_state.value = form.b_state.value; document.getElementById('_s_state').value = ""; } }

copybilling2.js
Code:
function InitSaveVariables_shipping(form){ s_address = form.s_address.value; s_address_2 = form.s_address_2.value; s_city = form.s_city.value; s_state = form.s_state.value; _s_state = form._s_state.value; s_country = form.s_country.value; s_zipcode = form.s_zipcode.value; } function copybilling(form){ if (form.copyb.checked){ InitSaveVariables_shipping(form); form.s_address.value = form.b_address.value; form.s_address_2.value = form.b_address_2.value; form.s_city.value = form.b_city.value; form.s_state.value = form.b_state.value; form._s_state.value = form._b_state.value; form.s_country.value = form.b_country.value; form.s_zipcode.value = form.b_zipcode.value; } else { form.s_address.value = ""; form.s_address_2.value = ""; form.s_city.value = ""; form.s_state.value = form.b_state.value; form._s_state.value = ""; form.s_country.value = form.b_country.value; form.s_zipcode.value = ""; } }

In skin1/customer/home_checkout.tpl

after
Code:
<link rel="stylesheet" href="{$SkinDir}/{#CSSFile#}">

add this code
Code:
<script language=JavaScript1.3 src="{$SkinDir}/copybilling1.js"></script>

In skin1/customer/home.tpl

after
Code:
<link rel="stylesheet" href="{$SkinDir}/{#CSSFile#}">

add this code
Code:
<script language=JavaScript1.3 src="{$SkinDir}/copybilling2.js"></script>

Find skin1/main/register_billing_address.tpl

After the last </TR>
add this code
Code:
{* ======== COPY BILLING TO SHIPPING MOD ======= *} <TR> <TD align="right"></TD> <TD></TD> <TD nowrap> <input type="checkbox" name="copyb" onclick=javascript:copybilling(this.form);>Use {$lng.lbl_billing_address} as {$lng.lbl_shipping_address} </TD> </TR> {* ======== COPY BILLING TO SHIPPING MOD ======= *}
__________________
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