Jump to content

Product Options CCv3


Guest candifloss

Recommended Posts

Guest candifloss

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Guest jmartinez

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

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