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)

CopperB 02-08-2005 04:42 PM

Thanks for the reply DogByte but I cannot find this template.

Quote:

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>

Are you sure about the home_checkout.tpl?

Thanks

balinor 02-08-2005 04:50 PM

I believe the code posted by Dogbyteman only works if you have Jon's EzCheckout mod installed.

CopperB 02-08-2005 05:03 PM

Yep I'm going blind. Missed the reference to the ezCheckout mod by jon.

jeremy35 02-08-2005 10:58 PM

Quote:

Originally Posted by CC
jeremy35 you still got errors man.

Just checked it out on your site...


Yep, you're right...I missed the register issue. Thanks for the heads up.

Bradc 02-09-2005 08:15 AM

Hi all

Quick little hack so that the "Use Billing Address as Shipping Address" check box only shows up in anonymous check out and not in "create profile" (leave empty if same as billing address seems to work fine).

Code:

{* ======== COPY BILLING TO SHIPPING MOD ======= *}
{if $action eq "cart"}
<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>
{/if}
{* ======== COPY BILLING TO SHIPPING MOD ======= *}


Hope this helps! :D

CopperB 02-09-2005 03:12 PM

Thanks Brad. works like a charm.

I am still wondering if anyone has done this with an " Additional " Phone field in Billing and Shipping at anonymous check out.

As this is an additional field the code for this mod is not copying the phone field. I have not been able to figure out the additional code I need to add/call on in the copybilling.js

Also if I need to change/add any of the code in the other templates used.

If needed the website (which is not live yet) is at: http://www.copperboppers.com/xcart/home.php

Thanks again. :D

torola 02-16-2005 12:24 PM

See message bellow

Tom

torola 02-17-2005 02:46 PM

Quote:

Originally Posted by CC
It would appear that some are not giving consideration to the two different registration forms.

Remeber, there is a Checkout sign up page AND and general register page.

They dont have the same sign up fields.
The general sign up page does not ask for the a Name twice, the checkout sign up does.

So on the general signup you have no name field to carry across twice, hence the error.

Either create two templates for this or use this .js code:
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 = "";
  }
}




The code works great except for one thing.

Here is my situation

My default country is Canada, so once I enter the registration page automatically country Canada is selected and you can choose Canadian Provinces.

Now, when a customer from US comes on the page and enters his address, changes country to United Stetes, and then chooses one of the US states, and everything seems OK

Then when you click on

"Use billing same as shipping addres" everything gets moved to the Shipping section, except for the states still show only Canadian Provinces even though the country changed to United States, you can only select Canadian province here.

Please let me know if this can be resolved somehow.

Thanks for the great mod.
Tom

Bella Forma 02-24-2005 06:55 PM

Just wanted to pop back and clarify something that was puzzling me and may puzzle others.

When I read this post initially a few people commented about the xcart default of 'leave empty if same as billing address' working just fine for version 4.0.*

I thought this was a bit odd as I am on version 4.0.11 and is wasn't showing so I presumed I must have messed it up when editing templates previously.

However today I decided to make my shipping fields 'not required' in the User Profile and lo and behold the 'leave empty if same as billing address' appears again and does indeed work just fine.

So you only have to use this mod if your shipping fields are required, unless of course you just prefer a checkbox.

Sorry if this is stating the obvious :lol:

torola 02-25-2005 09:32 AM

Yes, you are right Bella Forma,

but that works only on the registration page.

Once in cart, proceed to check out, here you don't have that option and everything needs to be entered separately.

Tom


All times are GMT -8. The time now is 06:44 AM.

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