X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Address Fields (https://forum.x-cart.com/showthread.php?t=8002)

BenderNZ 06-08-2004 10:57 PM

Address Fields
 
Hi,

I've searched but can't find anyone else with the same issue.

When customers go to register on our store, they have to fill in the following details:

Address *
City *
State * Pull Down Menu
Country * Pull Down Menu
Post Code *

I've edited Zip Code to read Post Code.

In New Zealand we use Suburbs on the postal addresses, and it's not practical to add every single suburb in New Zealand to the menu.

Is there some way I can make the State field free format, as opposed to a pull down menu?

Thanks in advance

shan 06-09-2004 02:17 AM

just delete all the states that you have and it will become a text box

thewho 06-15-2004 12:17 PM

i am trying to disable the state and the country from showing up in the
Registration form, so i wrote the fallowing if

Code:

{if $store_language ne "FL"}
        <tr valign=middle>
        <td align=right>{$lng.lbl_state}</td>
        <td>{if $states ne ""}<font class=Star>*</font>{/if}</td>
        <td nowrap>
        {include file="main/states.tpl" states=$states name="b_state" default=$userinfo.b_state default_country=$userinfo.b_country}
        </td>
        </tr>

        <tr valign=middle>
        <td align=right>{$lng.lbl_country}</td>
        <td><font class=Star>*</font></td>
        <td nowrap>
        <select name=b_country onChange="check_zip_code()">
        {section name=country_idx loop=$countries}
        <option value={$countries[country_idx].country_code} {if $userinfo.b_country eq $countries[country_idx].country_code}selected{elseif $countries[country_idx].country_code eq $config.General.default_country and $userinfo.b_country eq ""}selected{/if}>{$countries[country_idx].country}</option>
        {/section}
        </select>
        </td>
        </tr>
{/if}


but when i try to register the display is ok(no state and no country)
but the submit give me an error that i have mistakes in my form.
any idea ?


and another thing,
why "register.php" won't recognize the variable "$store_language"

FX 06-16-2004 08:46 PM

in include/register.php find and comment out this code:
(!empty($states) && empty($b_state)) || empty($b_country) ||

Original
$fillerror = (empty($uname) || !empty($error) || empty($passwd1) || empty($passwd2) || ($passwd1 != $passwd2) || empty($firstname) || empty($lastname) || empty($b_address) || empty($b_city) || (!empty($states) && empty($b_state)) || empty($b_country) || empty($b_zipcode) || empty($phone) || empty($email));

Modified
$fillerror = (empty($uname) || !empty($error) || empty($passwd1) || empty($passwd2) || ($passwd1 != $passwd2) || empty($firstname) || empty($lastname) || empty($b_address) || empty($b_city) ||/* (!empty($states) && empty($b_state)) || empty($b_country) || */empty($b_zipcode) || empty($phone) || empty($email));

This code validates if you've selected or not state and/or country in your register form. So if you disable anything in register.tpl file you also have to disable validation checks in register.php because if you disable the state and the country from showing up in the Registration form, for register.php it means you didn't select anything and it won't let you complete registration process.

:idea: try this out, it should work

BenderNZ 06-20-2004 03:12 AM

Quote:

Originally Posted by shan
just delete all the states that you have and it will become a text box


Hrm, I tried that but then got to the point of shipping and my customers would then be able to select all shipping options, and the prices vary based on whether they're in a given city, we don't want users picking the cheapest option, paying then getting grumpy when we tell them that they can't do that.

Is there an easier way to get two address fields? I tried a tutorial I found in another forum here but it seems too patchy.


All times are GMT -8. The time now is 08:47 AM.

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