Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

register form in checkout mode - summary

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 06-20-2005, 05:45 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,052
 

Default register form in checkout mode - summary

There are a lot of threads regarding entering names 3 times in the checkout register form. The main one has over 3500 views and 6 pages of discussion. If like me you find this confusing and you need a fix for standard 4.0.13 that covers most requirements, then hopefully this will help. (If you are an administrator and I have started a new topic when I shouldn't, sorry, just trying to make a complicated problem to solve via the forum simpler.)

The main thread (http://forum.x-cart.com/viewtopic.php?t=17146&highlight=profile) branches off to solve the problem for version 3, then for Jon's EzCheckout, making it hard to follow and implement a standard fix.

This post:
  • Saves your customer typing in names more than once in the checkout register form.
    still allows them to enter different names if they want to for Billing and Shipping
    Designed for standard 4.0.13
    Makes changes to the register form in checkout.
    Accounts for fact there are 2 register forms, therefore preserves normal register/create profile form


When customer starts the form, enters First and last name; these are duplicated to Billing Address (but not to Shipping)
Fills in the rest of Billing Address. Click the check box to duplicate name and address to Shipping.
Includes County/State and Country.

Doesn't matter if fields are mandatory, as they will get filled in one way or the other, but doesn't remove them as they may well be needed.


1) Open main/register_personal_info.tpl
Find INPUT fields for firstname and lastname
ADD THIS CODE to end of tag

onChange="populateProfile()"

e.g.
<INPUT type="text" id="firstname" name="firstname" size="32" maxlength="32" value="{$userinfo.firstname}" onChange="populateProfile()">

2) Open main/register_billing_address.tpl
After the last </TR>
add this 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 ======= *}

3) in skin1, make copybilling.js

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

4) Open common_js.tpl
Add this function

function populateProfile() {
document.registerform.s_firstname.value = document.registerform.firstname.value;
document.registerform.s_lastname.value = document.registerform.lastname.value;
document.registerform.b_firstname.value = document.registerform.firstname.value;
document.registerform.b_lastname.value = document.registerform.lastname.value
}

5)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>


Have basically taken work done by these people and put it all together in something that works for me; hopefully someone else can make use of it...

Credits:

Bob: bobcc99
http://forum.x-cart.com/viewtopic.php?t=17146&highlight=profile

PhilJ

CC

Bradc
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #2  
Old 10-26-2005, 02:59 PM
 
epic epic is offline
 

Member
  
Join Date: May 2005
Posts: 19
 

Default

Worked great!! Thanks
Reply With Quote
  #3  
Old 11-02-2005, 06:55 PM
 
elviselviselvis elviselviselvis is offline
 

Newbie
  
Join Date: Oct 2005
Posts: 6
 

Default

pauldodman

Thanks for summarizing and posting your very helpful method for trimming down the number of times a customer has to enter their name etc.
I did have trouble keeping the First and Last name manditory as it appears something fails to be filled and i get an error message that not all fields are filled when clicking submit button.
www.winterdrive.com

Cheers!

Sam
__________________
x-Cart version 4.0.16
www.winterdrive.com
Reply With Quote
  #4  
Old 11-03-2005, 01:33 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,052
 

Default

Hi,

It seems you also have a javascript error on the page.

As you don't have all the sections on the page, ie the first section is missing, it is possible that by removing it from the template, you are only removing the display but not the checking that everything has been filled in. So you are possibly checking for fields that although not displayed are still there. Would need to check your code to be sure, but there seem to be a few errors with what you have done.
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #5  
Old 11-04-2005, 12:05 PM
  fitster's Avatar 
fitster fitster is offline
 

Member
  
Join Date: Aug 2005
Location: A little shack outside La Grange TX
Posts: 19
 

Default

Nice job with putting it all in one place. One minor thing, It doesn't show the shipping name at order confirmation (last screen where you submit). It does show up on the receipt, but it might be disconcerting to the customer if they are shipping to someone else and the name doesn't show up before they finish the order.
__________________
"Neighbor" Dave Fillmore
Xcart 4.3.2 Gold
UNIX US
Hard Hat Hosting VPS
www.chilegrill.com
Reply With Quote
  #6  
Old 11-04-2005, 12:22 PM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,052
 

Default

OK, well it is late here now, so I will have a look when I get chance and let you know how to solve that.
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #7  
Old 11-07-2005, 11:33 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,052
 

Default

Hi Dave,

Firstly, had a look at some of my sites with this mod on and they seem to be carrying the shipping info forward OK.

However, was going to look at your site, but I couldn't get it to go to any of the products. Tried a few links, well I can't say it took a long time, cos I couldn't get any to go - it is still doing one now and I'm on broadband.

Moving back to the original question, what payment methods are you using?

Will have another look at your site tomorrow. Otherwise send me a PM or email to let me know if there is a problem and I'll wait till it is working - or let me know if you need some help with it.

(Just tried again - still no go)
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #8  
Old 02-24-2006, 08:05 AM
 
Phlash Phlash is offline
 

Newbie
  
Join Date: Feb 2005
Location: Ridge Manor, FL
Posts: 5
 

Default county

I'm new to X-Cart, but have been reading forums - and trying to learn everything I can.
I find this mod a LOT more user-friendly, than the standard checkout.

However, I NEED info on how to make it copy the COUNTY over, as well.

This is due to my state (FL) having about 5 different tax rates, determined by their 'ship-to' county.

Can anyone advise/update this code, and explain how I can do this?

This is what I tried (but it doesn't work):
---------------------------------

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_county = form.s_county.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_county.value = form.b_county.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_county.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 = "";
}
}

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

I assume either I have the wrong value, OR I need to do something within the 'change' areas?

Also, (while on the County subject) I'd also like to swap the county/state to state/county on the checkout, as well.
Therefore a customer wouldn't have to back-track to enter their county, above the state.
I read that this is done in "register_billing_address.tpl", AND "register_shipping_address.tpl" - but ain't smart enough to figure that out, either...

Please HELP - as I would like to get my current site switched over to X-Cart soon.

Thanks in advance,
Gordon
__________________
4.0.17 gold
Reply With Quote
  #9  
Old 02-24-2006, 08:38 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,052
 

Default

Hi, I am not 100% familiar with US addresses, but I thought that you either had state OR county in the address. By default you would have state in the US, and county in the UK. So I guess you must have added county somehow - perhaps turning it on through the User Profiles Option?
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #10  
Old 02-24-2006, 08:52 AM
 
Phlash Phlash is offline
 

Newbie
  
Join Date: Feb 2005
Location: Ridge Manor, FL
Posts: 5
 

Default

Yes, I turned it on 'county' - only for taxing reasons.
They have nothing to do with our addresses.
For example, if a customer buys the item in 'county A' - but wants it shipped to 'county B' - I have to charge the 'county B' tax rate.

I just need to collect the county from the customer, with the rest of their info - for tax calculation only.
All of my taxes are set up, and appear to work fine. - So taxes, or addresses aren't the issue.

The problem I'm facing is that this particular mod won't pass the county field into the ship-to-address, when the box is checked. - thus, not being able to complete the sale - untill the customer changes it manually.

It should be a simple fix, but - as I said, I'm probably too stupid...

Thanks,
Gordon
__________________
4.0.17 gold
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:30 PM.

   

 
X-Cart forums © 2001-2020