close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Sort order for options

Thread began 1/28/2010 9:27 pm by jaa397769 | Last modified 2/28/2011 1:17 pm by ripair417048 | 1797 views | 13 replies |

jaa397769

Sort order for options

Please help, when I create a product for my online store, and then assign the add/option
Size: and then give the variables
xs
s
m
l
xl

It is sorting it by ascending so it comes out
xs "only because I assign it as default"
then
l
m
s
xl

I know this is how the database is seeing it, and I only see the option in mysql for
Ascending, Descending or None. When I selected NONE for the sort option, I still get an alphabetical sort. Is there a way for me to have the sort work so that I would have the drop down look like this always

XS
S
M
L
XL

Thank you very much.

Sign in to reply to this post

Dani Chankhour

On your product Detail page look for this line of code:

$AddToWhere." ORDER BY OptionName" and change it to:

$AddToWhere." "

This will order the options based on order your entered the options which will give you the results you are looking for.

Sign in to reply to this post

jaa397769

That doesnt work

This is not the problem, After I add the item to my database when I add the options for the drop downs for size or color it is sorting alphabetically. I need to be able to sort in the order I place it in the option fields. Unless you told me the wrong page to edit, I edited that page and the code started at line 429. But I still got the same results.

Sign in to reply to this post

Dani Chankhour

Sorry, i might have misread your post.

Currently the only way to sort would be alphabetically, if you want to sort by the order you enter the options, then we need to add another column to your optiongroups table (optiongroupsdate) and set the type to timestamp and set the default value to "CURRENT_TIMESTAMP" and then we can change the order to order by optiongroupsdate at line 429.

Sign in to reply to this post

Dani Chankhour

It is actually the options table that you need to add the column to, not the optiongroups table.

Sign in to reply to this post

jaa397769

do i have to do this in

Myphpadmin for sql. If so do you have any documentation on how to do it? Or is it as simple as adding a column and giving it the attributes you said to.

Also wont I need some code written for my Product_Display.php page?
Thanks

Sign in to reply to this post

Dani Chankhour

We don't have any documentation on how to add a column to your database but it should be straightforward. In phpmyadmin, click on the options table and at the bottom you should see where it says add and at then end click the Go button and then type the name of the column, select time stamp for the type and select the current timestamp check box under the default value and click save.

Le me know if you have any questions about these steps.

Sign in to reply to this post

jaa397769

Ive created the table

I am still getting the same results.

This is what my recordset reads now, what should it read

SELECT Group_Concat(Concat(OptionGroupName,': ',OptionName)ORDER BY options.OptionGroupID, options.OptionID SEPARATOR ',\\r\\n') AS CartOptions
FROM options INNER JOIN productoptions ON productoptions.OptionID = options.OptionID INNER JOIN optiongroups ON optiongroups.OptionGroupID = options.OptionGroupID

Thanks

Sign in to reply to this post

Jimmy Wu

The ORDER BY part of the sql statement should be at the end of the query, not in the middle. Give that a try to see if it'll work.

Sign in to reply to this post

jaa397769

Order By

Will this change the way the option add ons lay out in the web page?

Also I created that table you told me to and it's collecting the time stamps, but I still have the same problem when the drop down menu is pressed, its all out of order.
Can you show me how that statement should read?

also I just tried in the backend admin add options section to put them in the list as such
1. Small
2. Medium
3. Large
4. X Large
5. XX Large

in the backend preview they listed correctly on the drop down, but on the live site it listed like this

3. Large
1. Small
4. X Large
5. XX Large
2. Medium

It just doesnt make sense. could you please tell me whats going on and why this is happening.


Thanks

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...