Guest candifloss Posted October 19, 2005 Share Posted October 19, 2005 Hi, at the moment my product options are ordered alphabetically which is fine in the most part, however my problem is that it just doesnt look right on screen eg. I have at the moment Colour Gift Boxed Size what I would like is Colour Size Gift Boxed is this an easy fix.. I have had a play around with the sql in the viewProd.inc.php file but couldnt quite find how to do it. Heres hoping you can help Chris Quote Link to comment Share on other sites More sharing options...
roban Posted October 19, 2005 Share Posted October 19, 2005 I had this same issue and I credit Sir William for the fix. This is from an e-mail he sent me regarding this issue. This worked for me: The options are, by default in alphabetical order so here's what you do: You need to edit /includes/content/viewProd.inc.php On or around line 154, you'll find the following: ------------ CODE SAMPLE ---------- // build sql query for product options luuuuuurvely $query = "SELECT ".$glob['dbprefix']."CubeCart_options_bot.option_id, ". $glob['dbprefix']."CubeCart_options_bot.value_id, option_price, option_symbol, value_name, option_name, assign_id FROM `". $glob['dbprefix']."CubeCart_options_bot` INNER JOIN `". $glob['dbprefix']."CubeCart_options_mid` ON ". $glob['dbprefix']."CubeCart_options_mid.value_id = ". $glob['dbprefix']."CubeCart_options_bot.value_id INNER JOIN `". $glob['dbprefix']."CubeCart_options_top` ON ". $glob['dbprefix']."CubeCart_options_bot.option_id = ". $glob['dbprefix']."CubeCart_options_top.option_id WHERE product =". $db->mySQLSafe($_GET['productId'])." ORDER BY option_name, value_name ASC"; ----------------------------------- (Note, I made it multi-line to make it easier to read) At the end after the "ORDER BY", simply remove the ", value_name" (remove the comma with it). That will pull them in by the order in the database then. Go to your SQL database and order the options the way you want before making this change. Quote Link to comment Share on other sites More sharing options...
Guest jmartinez Posted October 26, 2005 Share Posted October 26, 2005 You can also order by option price by doing this part... ------------ CODE SAMPLE ---------- // build sql query for product options luuuuuurvely $query = "SELECT ".$glob['dbprefix']."CubeCart_options_bot.option_id, ". $glob['dbprefix']."CubeCart_options_bot.value_id, option_price, option_symbol, value_name, option_name, assign_id FROM `". $glob['dbprefix']."CubeCart_options_bot` INNER JOIN `". $glob['dbprefix']."CubeCart_options_mid` ON ". $glob['dbprefix']."CubeCart_options_mid.value_id = ". $glob['dbprefix']."CubeCart_options_bot.value_id INNER JOIN `". $glob['dbprefix']."CubeCart_options_top` ON ". $glob['dbprefix']."CubeCart_options_bot.option_id = ". $glob['dbprefix']."CubeCart_options_top.option_id WHERE product =". $db->mySQLSafe($_GET['productId'])." ORDER BY option_name, value_name ASC"; ----------------------------------- (Note, I made it multi-line to make it easier to read) At the end after the "ORDER BY", simply remove the ", value_name" (remove the comma with it). That will pull them in by the order in the database then. However instead of just removing the ", value_name" you replace it with "option_price ASC" I used this tweek when setting shipping prices you can view it Here. Josh Quote Link to comment Share on other sites More sharing options...
Guest idara Posted October 26, 2005 Share Posted October 26, 2005 Nice website Josh :rolleyes: 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.