X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   check box for "same as billing address" (https://forum.x-cart.com/showthread.php?t=9160)

taltos1 05-31-2006 02:35 PM

I as well am very interested in an update on 4.0.18? Anyone got this working?
Thanks

cherie 05-31-2006 02:41 PM

Quote:

Originally Posted by taltos1
I as well am very interested in an update on 4.0.18? Anyone got this working?s

Yep, this is working on 4.0.18. :D

taltos1 05-31-2006 03:10 PM

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



cherie 05-31-2006 03:13 PM

Quote:

Originally Posted by taltos1
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?

Do you have any more details on what is not working? Have you used Firefox's Javascript Console to see if you get any errors? I find it invaluable when troubleshooting Javascript. :D

taltos1 06-01-2006 08:16 PM

Hmm. There are numerous it seems there are about 20-30 "unknown properties" is that right? Hmm.... I am not to familiar with this console, can you point me in the right direction.. THanks so much!

cherie 06-01-2006 08:29 PM

Quote:

Originally Posted by taltos1
Hmm. There are numerous it seems there are about 20-30 "unknown properties" is that right? Hmm.... I am not to familiar with this console, can you point me in the right direction.. THanks so much!

Click on Errors at the top to just show the errors (red items). It should give some more detail, such as what is triggering that error. My first thought is that the .js file is not loading or the function/property names you are referencing are incorrect. If you post or PM the web site then I'll take a look. :D

thundernugs 08-19-2006 12:17 AM

i've read through the posts for this mod, it seems folks are still having errors when trying to apply this to 4.0.18, without the ez checkout mod. are the problems occurring only for visitors with macs?

i was about to go through this mod, but since we sell lots of items that are specific to the macs, it would seem like a bad idea.

are there any other options to reduce the triple name entry?

thanks!

ecommerce 09-06-2006 10:17 PM

Re: check box for "same as billing address"
 
does anybody got it successfully working on 4.0.18 with jons easy checkout?

i need it to work with ez checkout and on ie, safari, mozilla, firefox, netscape.

id be happy to test urs also.

dfawdon 12-03-2006 01:15 AM

Re: check box for "same as billing address"
 
Quote:

Originally Posted by ecommerce
does anybody got it successfully working on 4.0.18 with jons easy checkout?

i need it to work with ez checkout and on ie, safari, mozilla, firefox, netscape.

id be happy to test urs also.


I have this working now with Jon's Easy Checkout, my version is 4.0.17, I used the post by taltos1 for insrtuctions, but amended the copybilling2.js as Firefox was not copying the details across from the standard register page, it was ok in the checkout.

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 = 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_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;
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_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 = "";
  }
}


2coolbaby 02-26-2007 01:47 PM

Re: check box for "same as billing address"
 
I used this with taltos1's instructions except for copybilling2.js, which was provided from dfawdon above. I own a mac & it is working wonderfully for me! I just wanted to let anyone who might be holding off due to the previous mac issue know.


All times are GMT -8. The time now is 02:07 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.