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)
-   -   Default state (https://forum.x-cart.com/showthread.php?t=45161)

swifty1 01-28-2009 09:30 AM

Default state
 
I need to do a slight tweak to my site i have searched this forum but there seems to be no full answers given. What i would like to do is on the customer registration page the county/state box defaults to the first alaphbetical name in the list, some customers are leaving the county/state at the default setting which is not correct for their address.
My solution is to create another state which will then be the default with a blank box (no text). Where is the list of county's/states in x-cart and will this work.

Tony

Rob_D 01-28-2009 02:30 PM

Re: Default state
 
The States and Countries are in your admin/management menu.

I added a state "**please select**". I made the state abbr. AA, so if sorted alphabetically, it would be at the top.

Make sure to check all browsers, because the javascript is handled differently. I beleive one of them (firefox I think) sorts by the primary field in the database, so you have to do a little manipulation.

Rob

swifty1 01-29-2009 09:21 AM

Re: Default state
 
Thanks Rob are you saying that i can edit the list in admin if so where is the list as i have checked all the sub menu's under admin/managment and don't have the list of states, may be i am missing a sub menu as i have had in the past because of a incompetent installation.

Tony

Rob_D 01-29-2009 09:35 AM

Re: Default state
 
Yes. In mine, it is just under "countries". A menu called "states". Just above "stop list"

Rob

swifty1 01-29-2009 10:58 AM

Re: Default state
 
It looks like i don't have that sub menu do you know how i can enable that sub menu.

Tony

Rob_D 01-29-2009 03:16 PM

Re: Default state
 
I am sorry, Tony, I don't. It was there when I installed Xcart. I am pretty new at this stuff. Hopefully an expert can jump in here.

Rob

swifty1 01-30-2009 07:04 AM

Re: Default state
 
Thanks Rob i have a feeling it may be supposed to be in skin1/admin/menu.tpl, if it is i do not have the states.tpl so i will need the code,can anybody help me out with this one.

Cheers Tony

balinor 01-30-2009 07:32 AM

Re: Default state
 
<a href="{$catalogs.admin}/states.php" class="VertMenuItems">{$lng.lbl_states}</a><br />

Goes in skin1/admin/menu.tpl

swifty1 01-30-2009 07:55 AM

Re: Default state
 
Thanks again Balinor it works a treat, what i don't understand is i have just had my site upgraded to 4.1.11 by x-cart so why was the states sub menu still missing.
For anybody who reads this thread i cut and paste the code supplied by balinor into skin1/admin/menu.tpl below
{include file="modules/Stop_List/stop_list_menu.tpl"}<br />

Cheers Tony

balinor 01-30-2009 07:57 AM

Re: Default state
 
If it was removed before they upgraded, upgrading wouldn't have added it back. Upgrading just edits code in existing files, it doesn't replace files.

swifty1 01-30-2009 08:07 AM

Re: Default state
 
Is there any where i can see what could be available in the admin sub menu's before a third party edits the sub menu lists as this is the second time i have had to add back a sub menu.

balinor 01-30-2009 08:08 AM

Re: Default state
 
Look in your skin1_original folder :)

swifty1 01-30-2009 08:38 AM

Re: Default state
 
Thanks Balinor your speed and knowledge are cool.
I have tried to create a new state code AA county **Please Select** it is at the top of the list in admin but from the front end it is hidden above the line below it, is it possible to have "Please Select" on view at the top of the list.

swifty1 01-30-2009 08:57 AM

Re: Default state
 
SORTED set default state in general settings

Rob_D 01-30-2009 09:19 AM

Re: Default state
 
Check it in different browsers. They sort the java code differently, and if your states have been moved around at all, and the sequence is out of order in the database, they will not sort the same.

Rob

swifty1 01-30-2009 09:43 AM

Re: Default state
 
Thanks for the reminder i have checked and all looks ok.

Tony

assman 02-22-2009 01:16 PM

Re: Default state
 
I have the default state changed to *Please Select State* and customers still forget to select one. So the order ends up with *Please Select State* on the shipping label. The pull-down should be blank and mandatory. Is there a way to make the default state blank such that the customer is forced pick a state?

Allen

gb2world 02-25-2009 12:09 AM

Re: Default state
 
Thanks for the tip, Rob.
Quote:

Is there a way to make the default state blank such that the customer is forced pick a state?

Instead of using AA as the code suggested above, leave the CODE field blank. When the javascript sees the option value set to blank, it triggers the messages to the customer that the fstate field needs to be selected.

swifty1 02-25-2009 04:30 AM

Re: Default state
 
Hi gb2world is it possible to have the explorer popup box to tell the customer to fill in the state/county field like it does for all the other fileds that are not correctly filled in.

gb2world 02-25-2009 05:14 PM

Re: Default state
 
Yes - that is what is happening. When the X-CART javascript code that checks the form sees the blank value associated with the "select a state" text that you added, it treats it as if you had left any other required field on the form blank and warns the user to make a selection.

One nuance - when you are in the administration, adding the new state, the form will not allow you to leave the Code filed blank. Just put something in. then, once it is accepted, you can go back and update it with null data.

Steve-C 09-21-2009 10:09 AM

Re: Default state
 
Does anyone have a fix to make the "states" sort properly in Firefox without affecting Internet Explorer?

Steve-C 09-23-2009 02:26 AM

Re: Default state
 
Quote:

Originally Posted by Steve-C
Does anyone have a fix to make the "states" sort properly in Firefox without affecting Internet Explorer?


I've no idea how to fix this by coding but if anyone is interested I made mine OK by re-sorting the database file.

In the database table there are the state names "state" and each one has a number associated with it "stateid". IE sorts by "state", FF sorts by "stateid".

I exported the table and in Excel I sorted the whole table by "state", then I moved my ---Please Select--- field to the top of the list. Next I sorted the "stateid" column ONLY so that it went straight down starting at 1 (the "please select" field).

After re-importing the table in phpMyAdmin it works fine in both browsers.

If you ever have to add or change the states you'll need to do it all again.


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

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