Guest Posted September 23, 2005 Share Posted September 23, 2005 Does anybody know how to make the product options dropdown box list the options from lowest to highest cost? I think I have to change the file: includes/content/viewprod.inc.php But i am not sure. Quote Link to comment Share on other sites More sharing options...
Guest vrakas Posted September 23, 2005 Share Posted September 23, 2005 Try the search button with "product options" and change the search posts from 90 or 120 days. I tryed it and i came up with to many results for me to post and help you. Hope this helps :) Quote Link to comment Share on other sites More sharing options...
Guest megagente Posted September 23, 2005 Share Posted September 23, 2005 I was looking for an even simpler way. Just making the product to show automatically sorted even if I have to change something on the code. I dont need the customers to press anything. Quote Link to comment Share on other sites More sharing options...
Guest tbladecki Posted September 23, 2005 Share Posted September 23, 2005 Yes i know how to do it.... you have to modify the DB request for the product options... look at the following site and lt me know if this what you are looking for: Link THis happens to be highest to lowest but you can change it around.. Quote Link to comment Share on other sites More sharing options...
roban Posted September 23, 2005 Share Posted September 23, 2005 Product options are set to display alphabetically no matter what order they are in the database but here's a fix. Go to your database and order them the way you like, then do this: You need to edit /includes/content/viewProd.inc.php On or around line 154, you'll find the following: CODE // 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"; (here it's multi-line to make it easier to read in the file it's one long line) 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. That's the way I did it. Quote Link to comment Share on other sites More sharing options...
Guest megagente Posted September 24, 2005 Share Posted September 24, 2005 http://www.desertcoralaquatics.com/estore/...viewCat&catId=4 Yes this is what I am looking for. And what happens when a new product is added? will it auto arrange in alphabetical order. Quote Link to comment Share on other sites More sharing options...
roban Posted September 24, 2005 Share Posted September 24, 2005 It will arrange in whatever order you've set your options in your database. The value_name is what makes it arrange in alphabetical order. If you delete this, it will arrange by your database values. If you look at my teeshirt site I have product options from small to xxxlarge. Before I changed this file it went from large as the first option. You want to go to yourdb_options_mid and arrange the values the way you want them. Quote Link to comment Share on other sites More sharing options...
Guest tbladecki Posted September 24, 2005 Share Posted September 24, 2005 Here is what I changed it to to sort that way: // 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_id, option_symbol, value_id DESC"; You can change it if you want to but this displays it just as on my site. Quote Link to comment Share on other sites More sharing options...
Guest megagente Posted September 24, 2005 Share Posted September 24, 2005 On phpmyadmin I cannot browse the options_mid table maybe because its nothing there. I used Roban method and evem went to many of the database tables and sort them but still dont see any result in the page. Quote Link to comment Share on other sites More sharing options...
Guest Posted September 25, 2005 Share Posted September 25, 2005 How would i arrange it lowest to highest Quote Link to comment Share on other sites More sharing options...
roban Posted September 25, 2005 Share Posted September 25, 2005 On phpmyadmin I cannot browse the options_mid table maybe because its nothing there. I used Roban method and evem went to many of the database tables and sort them but still dont see any result in the page. You're saying you can't check all and Browse? I can. Quote Link to comment Share on other sites More sharing options...
Guest tbladecki Posted September 25, 2005 Share Posted September 25, 2005 Ned I sent you an email Quote Link to comment Share on other sites More sharing options...
Guest megagente Posted September 25, 2005 Share Posted September 25, 2005 On phpmyadmin I cannot browse the options_mid table maybe because its nothing there. I used Roban method and evem went to many of the database tables and sort them but still dont see any result in the page. You're saying you can't check all and Browse? I can. i did not use the option settings on administration thats maybe the reason I get empty table. Quote Link to comment Share on other sites More sharing options...
Guest megagente Posted September 26, 2005 Share Posted September 26, 2005 what tables you sort on the database? You do it using the sort by Primary Key option? 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.