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)

adubas 08-30-2004 05:34 PM

check box for "same as billing address"
 
When a customer goes to put in personal info, there needs to be a way for them to click for shipping address "same as billing address" - the defaul says leave blank if same as billing address. If you use UPS online tools, it does not work. The fields stay mandatory no matter if you make it not mandatory or not... is there a way around this so my customers do not have to type the info 2 times on the same page? Leaving it blank like the directions say does not work.

shan 08-31-2004 07:25 AM

moved to bugs

inksticks 09-01-2004 01:55 PM

various bugs
 
Here are some suggestions some I think are just bugs that got over looked.

Make the 'contact us' 'state' and 'country' fields work the same as the 'customer profile' 'state' and 'country' fields. i.e. When a customer selects a country the appropriate states are presented rather then showing all available states for all countries.

Be able to choose the checkout 'active' and 'required' fields as you can for the user profile options in the admin general settings. This probably was over looked or assumed that setting them for customer profile would set them for checkout but they seem to work independently.

Do not display the default shipping city, state and zip code when customer uses anonymous checkout. Keep the fields blank as they are for the billing fields. So that they will copy the billing information when not filled in. A better approach would be to have a check box that the customer could check when his shipping address was the same as the billing. By clicking this check box the customers billing fields would be automatically copied to the shipping fields.

I hope that we can get some of these bugs worked out of X-cart soon. It's a great product!

autocom 09-10-2004 04:36 PM

Error message
 
When I tried to leave the shipping address blank, it gives me an error message.
( Please make sure you properly filled in all the required fields! )is the message I get if I don't put in the shipping address. Then, we have to fill it out twice... I am using X-Cart 4.0

Can someone help?

EnriqueHavoc 09-10-2004 05:37 PM

i agree a checkbox would really help..

jimmy_ 10-11-2004 01:54 PM

Has anyone developed this checkbox?? I would be willing to pay for such a thing.... Could someone please help???

PhilJ 10-13-2004 11:31 AM

Possible solution...
 
Backup files first. Code works for me in v4.0.5

I've not tested it with a drop down menu for states/counties, but it should work ok.

I use an input box for the state/county field. When I change country, it resets the state field, but I can live with that.

---------------------------

1) Create a new file in the skin1 directory called copybilling.js
add this code:

Code:

{literal}
<script language="JavaScript1.2">

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

</script>
{/literal}


2) in skin1/customer/home.tpl

after

Code:

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

add this code

Code:

<script language=JavaScript1.3 src="{$SkinDir}/copybilling.js"></script>

3) find skin1/main/register_billing_address.tpl

After the last </TR>
add this code

add

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


---------------------------

Done.

I would then change the language variable - lbl_shipping_address_registration

from

Code:

Shipping Address (leave empty if same as billing address)

to just

Code:

Shipping Address

inksticks 10-14-2004 06:30 AM

This mod didn't work for me. I carefully followed the instructions but I'm getting an error on the checkout page both when the page loads and when I click on the 'Use Billing Address as Shipping Address' checkbox. I would appreciate help figuring out what is wrong. You can test it for yourself at http://www.inksticks.com/store

PhilJ 10-14-2004 06:33 AM

As I mentioned, I haven't tested it with drop down menus for the states field. I'll get back to you with a fix shortly.

PhilJ 10-14-2004 07:02 AM

Why can I not edit my post?


All times are GMT -8. The time now is 09:45 PM.

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