SibeSpace Posted February 4, 2008 Share Posted February 4, 2008 I've added a bunch of options to many of my products. Is there any way to set the default option and/or the sort order of the options? For example. Clothing comes in a range of size - S/M/L/XL/XXL/XXXL. In the option box it's listed Alphabetically - L/M/S/XL/XXL/XXXL I want the sort order to be from S -> XXXL. If I wanted XL to be the one that is default, is there any way to do this? thanks Quote Link to comment Share on other sites More sharing options...
Guest Posted February 5, 2008 Share Posted February 5, 2008 If you added them from small to large, then you could change the sort order to be by the ID, rather than alpha. I'm guessing you probably DID enter them in that order, so it would work fine for you. The other trick I've seen that works would be to add blank spaces. The more spaces, the more towards the beginning of the alphabet it would be. Example: (where x equals a space) xxxxS xxxM xxL xXL It looks odd, but the page doesn't render the spaces, only the way the database sees it. To change the sort as stated in my first solution, you would do it in this file: includes/content/ViewProd.inc.php Look for the line that begins: $query = "SELECT ".$glob['dbprefix']."CubeCart_options_bot.option_id, ".$glob['dbprefix']."CubeCart_options_bot.value_id Then make the last part of that line look like this: ORDER BY option_id, value_name ASC"; Quote Link to comment Share on other sites More sharing options...
SibeSpace Posted February 6, 2008 Author Share Posted February 6, 2008 I did enter them in the right order S/M/L/XL/XXL etc, but they are alphabetically sorted automatically into L/M/S/XL/XXL. I added "ORDER BY option_ID, value_name ASC";" at the end of the string but it's made no difference? Tried the spaces too, but that didn't work. I must be doing something wrong but can't see what. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.