Jump to content

[Resolved] product options not being sorted properly


cutecube

Recommended Posts

Running CC 6. See attached photos. Everything looks like it should work, but doesn't show product options properly.

Attached are photos of how the product options are shown in the db, in the admin panel, in the product admin, in the catalog.class.php file, and on the live site. Notice that the live site, even have numerous cache clearing, show a strange order to product options. File names indicate where the image was taken from. Another strange behavior, is that I entered the options into the product ordered by size of ssd. However, when I went back in to check, the sort order was reversed.

Any ideas that I can try to fix it?

cc_catalogue.class.php.jpg

cc_options_in_db.jpg

cc_options_in_product.jpg

cc_options_in_product_live.jpg

cc_admin.jpg

Link to comment
Share on other sites

In the database table CubeCart_option_value, it seems as if the 'priority' column is not getting a value.

Please visit admin, Product Options, Option Attributes tab, and select SSD Storage Options.

Move (click/drag) the 1TB above the 500GB table row. Click Save.

Refresh the view of the database table Cubecart_option_value.

Did the values in the 'priority' column change at all?

Does any row have a value other than '0' in the 'priority' column?

Your sig says you are running CC606. If this is still the case, there have been a number of issues that have been solved in later versions, some regarding product options. But I do not know if this specific issue has been solved.

Link to comment
Share on other sites

Attached are images just after making your changes.

Since the live listbox showed same order as admin/product attributes showed, AND db now shows Priority for those options, I went ahead and moved the 1TB back down, and now it looks like everything is working properly again. All other Options worked correctly. This set was the only ones that were not sorting properly.

Thanks for telling me to do that as I would have probably been scratching my head for a long time before discovering that.

Any ideas as to what happened, or what I could have possibly done wrong. It acted like a script didn't run/complete when I added those options.

This can be marked as SOLVED. Thanks, bsmither!

cc_admin_product_attributes.jpg

cc_db_after_change.jpg

cc_options_in_product_live.jpg

Link to comment
Share on other sites

"Any ideas as to what happened, or what I could have possibly done wrong."

My best guess, at this point, is that, because the Product Options page can get quite complex (I see that you have at least 16 Option Groups and at least 164 Option Attributes), the total number of POSTed key/value pairs could exceed PHP's default limit of 1000.

If exceeded, then data got lost and CubeCart's products.options.inc.php controller was working with incomplete data. (For CC6012, see lines 128-148. According to the Github, these lines have not ever changed for the CC6 series. So, I think upgrading would not have installed any solution.)

FYI: the All-in-One-Shipping module is incredibly easy to exceed PHP's POST key/value pair limit.

If you have the means, change PHP's limit to something outrageous, maybe 10000. If not, try to convince your hosting provider to do it.

Note -- I am not saying anything conclusive! This is just my best guess.

Link to comment
Share on other sites

Just to make sure we're on the same page, On any one product, there are at most 12 options available to pick from. Would it be possible in my situation to exceed the default PHP limit of 1,000 key/value pairs? Or, am I looking at the wrong area?

When/where would these key/value pairs be POSTed as to have it exceed PHP's limit and an INSERT statement fail to insert those options into the db?

And, finally, what happened when you told me to move that one option up a notch and save it.I'm particularly interested in this answer because, during my trying to get it working, I deleted all 4 of those options and re-added them twice and it still didn't work.

Thanks for taking the time to deal with this. You've been very helpful in this forum.

 

Link to comment
Share on other sites

"On any one product..."

No, this is working in the set of screens you use to initially create the options that will later be assigned to the product.

When adding new attributes, it is true that 'priority' is not set. (I'll post an issue in the Github.) It seems that one needs to first save the Option Attributes with the new attribute added. Note that there is no drag icon to settle this new attribute in an existing list. Only after saving, databasing the Option Attributes, and returning, and then saving again so that the priority order can be POSTed.

The query (Catalogue->getProductOptions() 22 lines into the method) does use an ORDER BY using the 'priority', and then using the 'value_name'.

To see what is getting POSTed, every major browser has its diagnostics functions. With Firefox, I prefer Firebug. Firefox has it's own Developer Tools, however. IE has its F12 suite of functions. I believe Chrome has something as well.

Link to comment
Share on other sites

On all the other attributes that I've entered in the past, I don't remember doing anymore than simply 'save'. However I may have done that sequence by accident.

So, after adding attributes, (no ordering icons show up), I 'save and return'. At this point, if something needs reordered or modified, I can reorder and edit things. Then, whether or not I make any changes, I click 'save'. I still need to check the amount of key/value pairs passed. If large, change PHP limits. Currently: max_input_vars 10000 10000

If that's not correct, then I didn't understand your sequence. If that is correct, I don't need a response and I thank you again for your help.

Link to comment
Share on other sites

I use a2hosting, which was recommended by CubeCart as one of the best Shared Hosting providers for Cubecart. They say that s2hosting is setup properly, including all SSD drives to run Cubecart properly. I guess that's one of the changes they made for us. So far, I have been very happy with them.

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