I got the following to work in 4.0.18, and I am using the exCheckout Mod, however it only works during the checkout part, and not the "register" part, I read and reread all the posts but I am at a lose as to how to make this work there as well?
Any ideas?
Thanks a lot
Quote:
Originally Posted by DogByteMan
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 ======= *}
|