check box for "same as billing address
Siripakdi ;
please email me at xcartdev@diamondmm.com . I will send you the file. If it works for you than we can publish it. :) |
Quote:
Did anyone get a chance to fix this problem with state/province copying? Thanks Tom |
Simplifying the Checkout Form
This is another workaround for X-Cart Gold version 4.0.13 that I am trying on a new installation (not live yet). It needs some more testing, but may help others with this problem. Perhaps this post belongs in 4.0.13 - Cannot do anonymous checkout or register. Both threads are aimed at solving the problem of entering names more than once.
Step 1: General Settings : User Profile options Set "First Name" and "Last Name" to Active and Required. Step 2: Apply this patch, http://forum.x-cart.com/download.php?id=9 which allows the ship to names to be left blank. Shoppers will see a message: Shipping Address (leave empty if same as billing address). The patch changes only a few lines in two files. The "-" (minus sign) indicates the code that is removed, and the "+" (plus sign) indicates the code that replaces it. Step 3: Hide the billing names by changing in register_billing_address.tpl starting at about line 28 from: Code:
{if $default_fields.firstname.avail eq 'Y'} to: Code:
{if $default_fields.firstname.avail eq 'Y'} Step 4: Make an onBlur event to move data entered in the personal name fields to the billing fields by changing in register_personal_info.tpl starting at about line 27 from: Code:
<INPUT type="text" id="firstname" name="firstname" size="32" maxlength="32" value="{$userinfo.firstname}"> to: Code:
<SCRIPT type="text/javascript"> |
Can someone post a step by step guide
I followed the instructions and its not working for me.
I get errors on my page and nothing copies over. I do have 2 additional fields called phone in shipping and billing ( could this be a problem?) Can someone post a current step by step instruction for this change? Thanks! |
I would very much appreciate a current step by step for 4.0.13 as well!
|
works in 4.0.13
Hi all
I got this working ok in 4.0.13 Have you applied the patch mentioned at the beginning of the post? http://forum.x-cart.com/download.php?id=9 The only thing I did differently was the position of the {literal} tags. I put them outside the <SCRIPT> tags. I don't know whether that would make a difference though, it's just the way I've always done it. Code:
{literal} is the way i did the javascript functions. not much difference though. steve |
This is my first post, so I hope that I get it right.
I'm new to Xcart, having set up my first store (4.0.13) over the past 3-4 weeks. I mostly like Xcart, but I was disappointed as we all are in this thread with the clunky anonymous checkout (WRT title, firstname, & lastname having to be entered three times). I like it that the user has the flexibility to be one person, bill to a 2nd person, and ship to a 3rd, but really this is not a usual situation in my mind. So I've read with great interest this thread and have taken the great suggestions and code fragments and put together my own version of the anonymous checkout form. My mod has two checkboxes, one to copy title/firstname/lastname in Personal Information down to billing address, and another to copy the billing address (including b_title/b_firstname/b_lastname) down to shipping address. I borrowed heavily from all the posts here. What I've added is the title stuff and also when you uncheck, it goes back to what it was before you checked (which seemed to be intended in all the copybilling.js files that I saw, but not fully fleshed out). I don't think this breaks the user registration form. The .js files go in skin1. copynames.js: Code:
function InitSaveVariables_names(form) { copybilling.js: Code:
function InitSaveVariables_shipping(form) { home.tpl diff: Code:
--- skin1_original/customer/home.tpl 2004-12-01 09:15:48.000000000 -0600 register_billing_address.tpl diff: Code:
--- skin1_original/main/register_billing_address.tpl 2005-03-09 05:44:27.000000000 -0600 register_shipping_address.tpl diff: Code:
--- skin1_original/main/register_shipping_address.tpl 2005-03-09 05:44:27.000000000 -0600 I think that that's everything. I'd be interested to know if anyone can see anything wrong with it. Griff |
I forgot to ask something in my previous post. Can someone explain the change_states function to me? There seems to be three lines of code necessary to copy the billing state down to the shipping state, and I don't quite understand what's going on there. I did notice that the drop-down for the state differs from the title and country in that a SPAN is used in conjunction with some javascript instead of INPUT with a bunch of OPTIONs. So I understand that it *needs* to be different, but it's the how that confuses me.
For example, all the copybilling.js examples I've seen here say Code:
change_states(document.getElementById('s_country'), 's_state', 'State/Province', '', '', '', ''); Why does it reference s_country? I thought we were changing the state! Also, I thought change_states had 10 args, but the example above supplies 7 . Finally, why "State/Province" ? It appears from looking at change_states_js.tpl that the 3rd arg is supposed to be the County (which I don't happen to use). Anyway, I can't really complain, because it all seems to work, but there's nothing that upsets my apple cart worse than something that looks like it shouldn't work, but does. :? Griff |
@Griff:
Nice rollup onf information. I implemented it on 4.0.13 and everything seems to be working with one exception. When checking the boxes everything works except the 'title' does not get copied and actually makes the destination 'title' field blank. I looked to make sure there were no typos in the javascript for the field names and there don't seem to be any. Not sure why it doesnt work. Anyone have any insight? |
I figured it out and now the title is working along with everything else.
I had to modify the source slightly for the title fields in register_ personal/billing/shipping _address.tpl register_personal_address.tpl: Find: Code:
<OPTION {if $userinfo.title eq $name_titles[title]}selected{/if}>{$name_titles[title]}</OPTION> Replace with: Code:
<OPTION{if $userinfo.title eq $name_titles[title]} selected{/if} value="{$name_titles[title]}">{$name_titles[title]}</OPTION> For register_billing_address.tpl: Find: Code:
<OPTION {if $userinfo.b_title eq $name_titles[title]}selected{/if}>{$name_titles[title]}</OPTION> Replace with: Code:
<OPTION{if $userinfo.b_title eq $name_titles[title]} selected{/if} value="{$name_titles[title]}">{$name_titles[title]}</OPTION> For register_shipping_address.tpl: Find: Code:
<OPTION {if $userinfo.s_title eq $name_titles[title]}selected{/if}>{$name_titles[title]}</OPTION> Replace with: Code:
<OPTION{if $userinfo.s_title eq $name_titles[title]} selected{/if} value="{$name_titles[title]}">{$name_titles[title]}</OPTION> |
All times are GMT -8. The time now is 10:23 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.