Support Forums

Extra Field Options ordering

This is a discussion on Extra Field Options ordering within the Technical Support forums, part of the Technical Support Forums category; V4.2.1 Developer (edit), default I have added an extra field (CONDITION, drop-down), in which I have a few options (new, ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

Reply
 
Thread Tools Display Modes
Old 03-11-2011, 10:08 AM   #1
Junior Member
 
Join Date: Mar 2011
Posts: 4
Rep Power: 0
markjackson is on a distinguished road
Default Extra Field Options ordering

V4.2.1 Developer (edit), default

I have added an extra field (CONDITION, drop-down), in which I have a few options (new, like new, perfect, good, poor, ...

I would like them to display in the order as I just typed, makes since new-to-poor, but it auto displays in alpha order. Is there a way to change that. I see setting for weight in other section of the site, but not Extra Field-Options?

Thanks

Last edited by markjackson; 03-11-2011 at 02:29 PM.
markjackson is offline   Reply With Quote
Old 03-11-2011, 10:47 AM   #2
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,158
Rep Power: 64
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

Although may not be the elegant way, is to simply prefix your options with either a number or character.

Like this:
a. new
b. like new
c. perfect
d. good
e. poor

or numbers.

As with anything there are other methods, with this example in particular would be much more complex.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 03-11-2011, 11:18 AM   #3
Junior Member
 
Join Date: Mar 2011
Posts: 4
Rep Power: 0
markjackson is on a distinguished road
Default

Just wanted to see if there was another option before I started my build out.

Do you think adding a number or letter to get the order I want hurt searching for say "like new".
markjackson is offline   Reply With Quote
Old 03-11-2011, 11:53 AM   #4
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,047
Rep Power: 75
seymourjames is a jewel in the rough
Default

Its a good question about searching although it certainly will not affect the dropdown in the search (you could manually code in the options if you don't have too many extrafields and options in the order you like). Try a little experiment on that.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates and list your 68C site on ClassifiedCodes.com

Last edited by seymourjames; 03-11-2011 at 11:56 AM.
seymourjames is offline   Reply With Quote
Old 03-11-2011, 12:08 PM   #5
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,158
Rep Power: 64
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

Quote:
Originally Posted by markjackson
Just wanted to see if there was another option before I started my build out.

Do you think adding a number or letter to get the order I want hurt searching for say "like new".
As this is already a drop down field, when you search it is also going to be a drop down field which means that it is going to populate the field as it appears, therefore that will not affect your searches.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out

Last edited by Mike-N-Tosh; 03-11-2011 at 12:20 PM.
Mike-N-Tosh is offline   Reply With Quote
Old 03-11-2011, 12:20 PM   #6
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,158
Rep Power: 64
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

Quote:
Originally Posted by seymourjames
Its a good question about searching although it certainly will not affect the dropdown in the search (you could manually code in the options if you don't have too many extrafields and options in the order you like). Try a little experiment on that.
Bear in mind that if this is NOT the only extra field that you have and is not a global field (e.g. assigned to ALL categories), manually coding the drop down will bring in much more complication to the issue as the extra fields are called via javascript/AJAX. This would affect both advanced search as well as the checkout.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 03-11-2011, 12:20 PM   #7
Staff
 
Join Date: Mar 2006
Location: New Jersey
Posts: 2,035
Rep Power: 64
John Snyder is a jewel in the rough
Default

Ordering them the way Mike described with numbers or letters is just about the only way to do this with the designer version.

In the developer version you could order by field option id, but it would be global effecting all extra field options. Depending on the page the you want to alter the display of options you would need to edit either ajax.php or includes/kernel/Listings.php, the change would be almost identical in both places.

Find:

PHP Code:
$ssql "SELECT optID,fieldID,optValue,optOrder FROM " PREFIX "fields_options WHERE fieldID=" . (int) $row['fID'] . " ORDER BY optValue"
Replace :

ORDER BY optValue

with:

ORDER BY optID
__________________
John
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
John Snyder is offline   Reply With Quote
Old 03-11-2011, 02:28 PM   #8
Junior Member
 
Join Date: Mar 2011
Posts: 4
Rep Power: 0
markjackson is on a distinguished road
Default

My mistake, I do have v4.2.1 Developer

It would be fine with me if all Extra Field Options listing based on optID then, but that leads to another question.

How do I set the optID value or is that based on the option box I am typing in?

Searching, so in my example if some just did a quick search for say "like new", the text in my Extra Field Option is not including in that. All Extra Field Options are search for based on the field type I have selected, not text search. So only the "title", "short description", and "description" are searched with text?


Thanks for the help guys, this is my first post here and you guy are very helpful.
markjackson is offline   Reply With Quote
Old 03-11-2011, 03:07 PM   #9
Staff
 
Join Date: Mar 2006
Location: New Jersey
Posts: 2,035
Rep Power: 64
John Snyder is a jewel in the rough
Default

optID is automatically set and should be in the order you add them
__________________
John
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
John Snyder is offline   Reply With Quote
Old 03-11-2011, 09:25 PM   #10
Junior Member
 
Join Date: Mar 2011
Posts: 4
Rep Power: 0
markjackson is on a distinguished road
Default

That may not work then, if I need to add a new option after a few weeks or months, then there would not way to say place it in the middle of the list. Really thinking the alpha or numeric before the options is going to end up as the winner. Unless I could add/adjust the optID inside the database directly.

Thanks again for the help.
markjackson is offline   Reply With Quote
Reply

Tags
extra , field , options , sort , weight

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extra Field Search / Save Extra Field to Short Desciption tlombard Technical Support 8 03-04-2010 05:18 PM
Extra Field and Search Options wabugi Technical Support 6 05-11-2009 11:58 AM
External URL Extra Options hel68c Technical Support 2 02-24-2009 11:37 AM
How to create dropdown list options for Extra Field in "User Registration Fields"? Success Technical Support 11 06-02-2008 10:38 AM


All times are GMT -4. The time now is 09:22 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0