Jump to content
Sign in to follow this  

Option attributes badly sorted after adding more options

Recommended Posts


I have a product an option group "Keys" with over 100 options attributes (individual keyboard keys).
The products are keyboard, with their different layouts are defined as option sets.

My options attributes that I set initially came from a QWERTY layout, and I sorted the keys carefully by groups "A B C D (...)   F1 F2 F3  F4 (...) 1 2 3 4 (...) and special keys.

Because of additional keyboard layouts, I had to add many new attributes afterwards (special chars like "é à ü" for instance).

Instead of adding those attributes at the end of the list, when saving the attributes list, CubeCart's manager insert them at arbitrary locations in the list.
This makes things difficult because to make my options set well-organized, I have to drag and drop a lot the new attributes through the very long list.
Although not a real bug, this is very boring and perfectible. I have no GitHub account and this is why I post here.



Share this post

Link to post
Share on other sites

May we see your site? (Not that I would be able to help on the backend - I would just like to see your inventory.)

Share this post

Link to post
Share on other sites

The site is still in development.

But I could find where the problem comes from.

Problem / Bug
When you add one (or more) new option attributes to an existing option group and click the "Save" button, the new options are saved in table CubeCart_option_value.
The last column in this table is "priority", which store the priority indexes in which the option attributes are displayed in the backend (and maybe also in the frontend).
If you add a new option attribute, it receive priority index "1".
Instead, it should receive priority index MAX(priority)+1.

Create option values "A", "B", "C", "D" for an option group and save.
Add option attribute "E" to the same option group and save.
E will receive priority "1".

(Partial ?) solution  (not tested yet but should work)
by Editing the MySQL CubeCart_option_value table:

  1. Make sure that the priority column of your "_option_value" tables are unique
  2. Using phpMyAdmin, click the "Structure" tab for the "_option_value" table
  3. Assign the "priority" column a "Unique" and make it "AUTO_INCREMENT" (check A_I in phpMyAdmin)

Maybe does Al Brookbanks knows if some code also has to be edited. I assume so.
With my solution, the values for the priority field should not be saved and this task delegated to the database.
But the "Option Attributes" tab also allows sorting fields by drag & drop and the new order has then to be saved in the priority field.
The current code (version 6.2.5) sets new priorities for all options.
Although  I didn't dig into the code, I assume there is some paradox here.
The problem when adding new fields is especially accutes if the existing number of option attributes is important.
(There are more than 100 option attributes in my case.)
Can someone report this bug in GitHub?

Edited by Julien

Share this post

Link to post
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.

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.

Sign in to follow this  

  • Create New...