Post by Polanter » Fri Jun 06, 2014 8:18 pm

I am having a problem using the options drop down, I seem to have reached the maximum number available. In fact I think there might be a better way to achieve what I want but just cant work it out, can anybody offer any help? Here is what I want to do.
I sell E-Liquids and have over 50 flavours and each flavour comes in 4 strengths so over 200 options. I am trying to add a product that says buy any 5 flavours for £x's but need the customer to be able to select 5 flavours and the strength for each flavour. The may select 5 different flavours with 5 different strengths or all the same in fact any combination.
I am looking for advice on how to set this up, can opencart do this or do I need to get an extension for this?
Many thanks in advance.
I am using open cart 1.5.6

New member

Posts

Joined
Thu Aug 16, 2012 9:05 pm

Post by Qphoria » Sat Jun 07, 2014 2:56 am

1. Create 50 products, one for each flavor and have 4 strengths per flavor. (Recommended)
2. Create 4 products, one for each strength, and have 50 options per flavor.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Polanter » Sat Jun 07, 2014 4:00 pm

HI
Thanks for the reply
option 1 I have this already in our standard shop
Option 2 I have started working on this but have now reached what I think is the max number of options, customers don't often mix strengths but they do love to mix flavours, I have set the page live that I have completed so far and if you look at the option boxes you will see box 3 is different from box 1 and 2 and I still need to add another 2 boxes as we are selling % for £10.
I will leave it up for the rest of the day in case you can offer any help http://shop.smokerscorner.co.uk/5-for-%C2%A310
Thanks again

New member

Posts

Joined
Thu Aug 16, 2012 9:05 pm

Post by Polanter » Sat Jun 07, 2014 10:13 pm

Ok I have managed to solve this I have increased the max_input_vars from 1000 to 3000 and now all is working.

New member

Posts

Joined
Thu Aug 16, 2012 9:05 pm

Post by nootkan » Tue Jun 17, 2014 10:04 am

Polanter wrote:Ok I have managed to solve this I have increased the max_input_vars from 1000 to 3000 and now all is working.
I too am having this problem. Could you tell me which file you made those changes to? I am using version 1.5.6.4 and checked the admin>controller>catalog>option.php file (among a few others) and couldn't find it there.

New member

Posts

Joined
Mon May 26, 2014 5:21 am

Post by Polanter » Tue Jun 17, 2014 4:14 pm

I had to ask my hosting provider to do it, its not something that can be done in opencart it has to be done on theserver side. once done I changed the limit on my side in php.ini in both he base folder and the admin folder. And it worked like a dream. Hope this helps

New member

Posts

Joined
Thu Aug 16, 2012 9:05 pm

Post by Dhaupin » Tue Jun 17, 2014 10:35 pm

We encountered the same thing -- options cap at exactly 151 values in default OC install. Max input vars helps the default OC option value limit. For those asking above, you put this into your "store/admin/php.ini" file like so: max_input_vars = 6000 keep in mind that there are 2 php.ini's -- 1 at root store level and 1 in admin folder. You can also attempt to set the max_input_vars via your store or admin HTACCESS, or even right in php, however many servers dont allow this override.

Here are some helpful admin php.ini settings including the max_input_vars

Code: Select all

date.timezone = 'America/New_York'
magic_quotes_gpc = Off
register_globals = Off
default_charset	= UTF-8
memory_limit = 128M
max_execution_time = 320
max_input_time = 240
upload_max_filesize = 999M
safe_mode = Off
mysql.connect_timeout = 30
session.use_cookies = On
session.use_trans_sid = Off
session.gc_maxlifetime = 172800
allow_url_fopen = on
max_input_vars = 6000
There are other issues too you may encounter depending on your extensions or product complexity:

1) Many mods use varchar cols in DB tables and they set it way too low. Grouped product ultimate for example, when setting the child product <=> hide it dependencies, you will notice it caps quite quickly and wont save the information. The notice says "successful" but when you go back to edit, you see it didnt save (even in some OC defaults). If this happens, goto phpMyAdmin and set the varchar of the offending field to something like higher like 5000 (careful not to cap bytes of 65535). Alternatively you can set varchar(max). Example is the "name" field in "option_description" table or the "child_to_hide" field in the "product_grouped_configurable" table. Both are far too low varchar

2) When using mega amounts of options your product edit page will slow to a halt when you add many rows of options with large amounts of values in the dropdown. This is partially due to AJAX and partially due to the browser using so much mem/cpu to render to many dropdowns with values. You cannot hide rows or it would invalidate "save" AJAX that must reiterate and add every row client side. There is no solution that i have found to this, however we are experimenting -- if anyone has a solution to this please please share how to reduce the product edit footprint when using large amounts of options.

Hope it helps, thanks!

https://creadev.org | support@creadev.org - Opencart Extensions, Integrations, & Development. Made in the USA.


User avatar
Active Member

Posts

Joined
Tue May 13, 2014 3:45 am
Location - PA

Post by nootkan » Wed Jun 18, 2014 1:39 am

Thanks for this much appreciated, I was beginning to think I would never figure this out. I had to make the changes in my .htaccess file as changes to the php files didn't do anything.

Here is what I added there in case someone else has the same set up.
php_value max_input_vars 6000
php_value suhosin.get.max_vars 6000
php_value suhosin.post.max_vars 6000
php_value suhosin.request.max_vars 6000
Spoke too soon, I am only able to create seven options but no more. I can create as many option values as I want inside those seven options however. Any ideas?

New member

Posts

Joined
Mon May 26, 2014 5:21 am

Post by Qphoria » Wed Jun 18, 2014 3:23 am

Eventually you are going to hit a ceiling with so many options being posted back at once. You would likely benefit from this Ajax Auto Save mod that saves each option (and other product fields) immediately upon edit, so no more than a few fields are being saved at any time. This way you can go indefinitely because it only saves when you edit.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Dhaupin » Wed Jun 18, 2014 4:25 am

If your HT doesnt seem to be changing it, you can confirm by using a php info.

To make one, make a file called "srv-inf.php" and put this in it:

Code: Select all

<?php phpinfo(); ?>
I have attached it too here if youre lazy. You can upload it to the root of your store, then visit it like yourstore.com/srv-inf.php to see what the max_ things are set at. If its still low then you know HT isnt powerful enough. If your ini doesnt work either, try contacting your host company (or set it yourself in WHM). Tell them your children are starving and and your ecom success depends on more vars, they will get right on it.

Attachments

Displays php info about your server when visited. Delete when done checking.


https://creadev.org | support@creadev.org - Opencart Extensions, Integrations, & Development. Made in the USA.


User avatar
Active Member

Posts

Joined
Tue May 13, 2014 3:45 am
Location - PA

Post by nootkan » Wed Jun 18, 2014 7:20 am

Well I'm at a loss to figure this out. I can add values to an existing product option and save. When I go to look at the option values a price is always at zero instead of the price I put in previously yet the other values are fine. It is always the top price in the order of the same option (11x14). I also cannot add even one product option with one value to the new product list so there must be a cap at seven.

Here is what I have set up for my product (photo): Options: Print Size with 12 values, 8x10 Single Mat with 42 values, 8x10 double mat with 22 values, 11x14 single mat with 42 values, 11x14 double mat with 22 values, 16x20 single mat with 42 values and 8x10 frame with 14 values. I still need options and values for 18x24, 20x24 and 24x36 mats and frames but open cart won't allow me to add them.

Here is a screenshot of my php.ini info:
The left is the Local Value and the right is the Master Value. Yet when I login to my server and view my php.ini file I cannot see any instance of the max_input_vars anywhere. There are two php.ini files one has a "v" after it and both have no occurrance of the max_input_vars.

Image

New member

Posts

Joined
Mon May 26, 2014 5:21 am

Post by Dhaupin » Wed Jun 18, 2014 8:56 am

Ah sorry its now working for ya. Albeit new to OC still, its strange, we fought the same "WTF" as you and input_vars seemed to solve it in a big way. The symptoms sound similar to what ours were. Granted we keyed our db about the same time, but didnt use prod options in keys (prob should in hindsight). It sounds like either parse or store is cutting it off -- i cant imagine its OC itself...

PHP instance appears to be functioning as an override regardless of the OC functionality. Are you using any options extensions?

Are you able to SSH into server and use root level "top" to see resources? (can monitor JSON/PHP->SQL load as you save)

If youre experienced, are you able to manually add an entry beyond what OC allows you to save? (can see if its DB bottleneck)

Still a bit green to OC, maybe some vet has thoughts on this! I will check it tomorrow live (mobile this eve) to see if prod->option is limited in our default-hacienda as well

https://creadev.org | support@creadev.org - Opencart Extensions, Integrations, & Development. Made in the USA.


User avatar
Active Member

Posts

Joined
Tue May 13, 2014 3:45 am
Location - PA

Post by nootkan » Thu Jun 19, 2014 5:30 am

Thanks for your reply, I'm glad someone is trying to help me with this. I'm on my third time deleting everything and re-installing fresh with the same results. Thought maybe it had something to do with using mysqllite instead of mysql database at install.
Dhaupin wrote:Granted we keyed our db about the same time, but didnt use prod options in keys (prob should in hindsight).
I'm not very experienced with databases. Could you explain what you mean by this?
Dhaupin wrote:Are you using any options extensions?
No this is a fresh install using the default theme and demo products.
Dhaupin wrote:Are you able to SSH into server and use root level "top" to see resources? (can monitor JSON/PHP->SQL load as you save)
Yes I can login to root via ssh or whm but not sure what you mean by monitoring resources while saving.
Dhaupin wrote:If youre experienced, are you able to manually add an entry beyond what OC allows you to save? (can see if its DB bottleneck)
Again not sure what you mean by this. Do you mean add the options directly into the database using phpmyadmin? If so, I tried that already and it didn't work.

New member

Posts

Joined
Mon May 26, 2014 5:21 am

Post by nootkan » Mon Jun 23, 2014 3:02 am

Well because I have been unable to resolve this I have chosen to use another shopping cart which handles all my options just fine. I am disappointed that I couldn't make opencart work for me but maybe I'll try again later with a different project that doesn't require so many options for each product. Was really hoping that someone here would be able to help me figure this out but oh well thanks to those who replied for trying.

New member

Posts

Joined
Mon May 26, 2014 5:21 am

Post by Dhaupin » Tue Jun 24, 2014 3:36 am

Sorry i was away some days at a festival :D Sorry you moved on

I would use mySQL instead of SQLite. Also it seems i may have been mistaken, on our install it shows the local settings in srv-inf.php as the *same* as overidden if its functioning. Perhaps its not listening to your overrides at all.

Keying your DB means making a table of contents more or less. I answered a post earlier with some tips in it about keys and stuff http://forum.opencart.com/viewtopic.php ... 65#p501927

Yes if you log in via SSH and watch "top" or tail -f various logs for AJAX "not found" or time out errors.

And yes i meant manually adding a line in the DB to see if it allows it to save. If not, often you can adjust *something* to raise the bar/limit -- however im not too sure about sqlite.

https://creadev.org | support@creadev.org - Opencart Extensions, Integrations, & Development. Made in the USA.


User avatar
Active Member

Posts

Joined
Tue May 13, 2014 3:45 am
Location - PA

Post by nootkan » Tue Jul 22, 2014 8:12 am

Just thought I`d update this post as I finished my other project and came back to try this again. This time I used mysql instead of the default mysql lite in the set up and confirmed all my php.ini settings were what they were supposed to be on my server. I then created a new category and a new option. I added 10 option values saving to the option then adding 10 more until I got all 215 inside the option and voila it worked! So I can only assume it must have been that I had used mysql lite instead of mysql. Whew glad that`s over. Now to add all the rest of the categories, options, option values and products to make sure I`m not being too premature in my assumptions. Thanks for all the direction and help with this and if I run into any other issues I will seek your help again.

New member

Posts

Joined
Mon May 26, 2014 5:21 am
Who is online

Users browsing this forum: No registered users and 38 guests