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)
-   -   register form in checkout mode - summary (https://forum.x-cart.com/showthread.php?t=14668)

pauldodman 02-24-2006 09:01 AM

Just noticing that you are using v 11, although the mod was put together for 13, it should still work. Are you planning on upgrading to 17 at all? 11 was full of bugs and 17 has improved this feature anyway, you don't need to fill it in - just leave it blank.

If you are going to do this, then you would save time trying to solve this.

Phlash 02-24-2006 09:09 AM

I am using 17...
Sorry.
I thought I changed it in my profile before posting this question.
I guess it didn't stick.

I know you can leave the ship-to blank - but though this 'check box' mod would make it look better....

pauldodman 02-24-2006 09:19 AM

It's kind of redundant in 17, you don't want people to have more clicks - less is best, gets them to the end quicker and then you get paid! No point adding things just to make it look cool - you have to think of the overall goal.

It's up to you though, if you want to try and solve it we can.

Phlash 03-05-2006 06:46 AM

OK.. you've talked me out of it... I did use part of the mod to copy the name down though.

I'd still like to figure out how to have it ask for the county AFTER the state in the checkout though...
It looks kinda funny asking for it before....

Anyone done this yet?

Thanks

ccakins 04-06-2006 11:51 AM

I was able to switch around the State and County order, but am still working on how to get the county field to show only when there are counties configured for that state.

So here's what you have to do. Go into /main/register_billing_address.tpl and find this code:
Code:

{if $default_fields.b_county.avail eq 'Y' and $config.General.use_counties eq "Y"}
<TR>
<TD align="right">{$lng.lbl_county}</TD>
<TD>{if $default_fields.b_county.required eq 'Y'}<FONT class="Star">*</FONT>{else}{/if}</TD>
<TD nowrap>
{include file="main/counties.tpl" counties=$counties name="b_county" default=$userinfo.b_county country_name="b_country"}
{if ($reg_error ne "" and $userinfo.b_county eq "" and $default_fields.b_county.required eq 'Y') or $error eq "b_county"}<FONT class="Star">&lt;&lt;</FONT>{/if}
</TD>
</TR>
{/if}


Move it so it's underneath the state block of code:
Code:

{if $default_fields.b_state.avail eq 'Y'}
<TR>
<TD align="right">{$lng.lbl_state}</TD>
<TD>{if $default_fields.b_state.required eq 'Y'}<FONT class="Star">*</FONT>{else}{/if}</TD>
<TD nowrap>
{include file="main/states.tpl" states=$states name="b_state" default=$userinfo.b_state default_country=$userinfo.b_country country_name="b_country"}
{if $error eq "b_statecode" and $default_fields.b_state.required eq 'Y'}<FONT class="Star">&lt;&lt;</FONT>{/if}
</TD>
</TR>
{/if}


Do the same thing for /main/register_shipping_address.tpl.

Phlash 04-07-2006 06:14 AM

Thanks, but that didn't work for me....
Is there anywhere else that we need to change the County/State order, to make this work?

My site looks rather confusing to the customer on the checkout page.
I WISH I could fix it...

Any other ideas?
BTW, your plan on making the County field only show up for states with county assigned sounds REAL good!
Let me know if you get that working...

Thanks
Gordon

ccakins 04-07-2006 08:46 AM

I'm trying to remember what exactly I did to make that change. I believe that was it. Make sure you're moving the code to the correct spot because there's 2 "blocks" of code for the state. You should be moving the county code under this line:

Code:

{if ($reg_error ne "" and $userinfo.s_state eq "" and $default_fields.s_state.required eq 'Y') or $error eq "s_statecode"}<FONT class="Star">&lt;&lt;</FONT>{/if}
</TD>
</TR>
{/if}


Ah, just found this one. Check out /main/register_states.tpl.

ajj 04-09-2006 06:57 PM

Re: register form in checkout mode - summary
 
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">&lt;&lt;</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">&lt;&lt;</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...

TA 06-03-2006 11:55 AM

Thanks for sharing this code ajj!

Has anybody tried this and are there any other issues?

summit 06-28-2006 07:16 AM

the code works up to the point where you hit the "Submit" button, at which point it give me errors about required fields....

any fix for this?


All times are GMT -8. The time now is 01:14 AM.

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