Jump to content

Product Options Question


roban

Recommended Posts

I have 6 options for tee shirts

small

medium

large

xlarge

xxlarge

xxxlarge

Now they are displayed as:

large

medium

small

xlarge

xxlarge

xxxlarge

I have them correct in my database but can't seem to change the order in admin/product options. They have a mind of their own. The id's are 15, 16,17,18,19,20 but display as 17,16,15,18,19,20

How can I change the order of the small, medium, large right now the default in the options box is 'large'

Link to comment
Share on other sites

Rob, they're in alphabetical order.

You need to edit /includes/content/viewProd.inc.php

On or around line 154, you'll find the following:

// 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.

Hope it helps.

Link to comment
Share on other sites

Hey all. I tried the fix mentioned above on my site as well. The order of things we no longer alphabetical, but were in random order depending on when i clicked where (odd eh?). I changed the "value_name" to say "value_id" and all went in the correct order. I would say that the only thing to pay attention to is the order in which options are added. Thanks for the suggestion. I would have never gone there.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...