Quote:
Originally Posted by pauldodman
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......
|
Hi,
i think the way you solve this problem is a bit complicate.
Why not just do this.
1. open include/register.php
find
Code:
if ($action == 'cart') {
if (empty($s_firstname) && $default_fields['firstname']['avail'] == 'Y') {
$HTTP_POST_VARS["s_firstname"] = $s_firstname = $firstname;
}
if (empty($s_lastname) && $default_fields['lastname']['avail'] == 'Y') {
$HTTP_POST_VARS["s_lastname"] = $s_lastname = $lastname;
}
after just add
Code:
if (empty($b_firstname) && $default_fields['firstname']['avail'] == 'Y') {
$HTTP_POST_VARS["b_firstname"] = $b_firstname = $firstname;
}
if (empty($b_lastname) && $default_fields['lastname']['avail'] == 'Y') {
$HTTP_POST_VARS["b_lastname"] = $b_lastname = $lastname;
}
if (empty($b_title) && $default_fields['title']['avail'] == 'Y') {
$HTTP_POST_VARS["b_title"] = $b_title = $title;
}
2. open skin1/main/register_billing_address.tpl
find
Code:
{if $default_fields.title.avail eq 'Y'}
<TR>
<TD align="right">{$lng.lbl_title}</TD>
<TD>{if $default_fields.title.required eq 'Y'}<FONT class="Star">*</FONT>{else}{/if}</TD>
<TD nowrap>
<SELECT name="b_title">
{section name=title loop=$name_titles}
<OPTION {if $userinfo.b_title eq $name_titles[title]}selected{/if}>{$name_titles[title]}</OPTION>
{/section}
</SELECT>
</TD>
</TR>
{/if}
{if $default_fields.firstname.avail eq 'Y'}
<TR>
<TD align="right">{$lng.lbl_first_name}</TD>
<TD>{if $default_fields.firstname.required eq 'Y'}<FONT class="Star">*</FONT>{else}{/if}</TD>
<TD nowrap>
<INPUT type="text" name="b_firstname" size="32" maxlength="32" value="{$userinfo.b_firstname}">
{if $reg_error ne "" and $userinfo.b_firstname eq "" && $default_fields.firstname.required eq 'Y'}<FONT class="Star"><<</FONT>{/if}
</TD>
</TR>
{/if}
{if $default_fields.lastname.avail eq 'Y'}
<TR>
<TD align="right">{$lng.lbl_last_name}</TD>
<TD>{if $default_fields.lastname.required eq 'Y'}<FONT class="Star">*</FONT>{else}{/if}</TD>
<TD nowrap>
<INPUT type="text" name="b_lastname" size="32" maxlength="32" value="{$userinfo.b_lastname}">
{if $reg_error ne "" and $userinfo.b_lastname eq "" && $default_fields.lastname.required eq 'Y'}<FONT class="Star"><<</FONT>{/if}
</TD>
</TR>
{/if}
replace with
Code:
<INPUT type="hidden" name="b_title" value="{$name_titles[title]}">
<INPUT type="hidden" name="b_firstname" value="{$userinfo.b_firstname}">
<INPUT type="hidden" name="b_lastname" value="{$userinfo.b_lastname}">
done...