OpenCart Option Value Limits (imposed by server)

If you’re like me you have an OpenCart site with thousands of possible option values for individual product options. Mine resulted from a large import of data. After which, I was no longer able to remove or add more option values (eg: too many fields in the form).

Many people think this is a limitation of OpenCart, which is not the case… the issue resides in your server’s PHP configuration. Specifically with PHP’s max_input_vars and post_max_size directives.

This is what was in my server’s php.ini file…

max_input_vars = 1000;
post_max_size = 8M;

So I updated the settings as follows…

max_input_vars = 5000;
post_max_size = 16M;

I hate modifying those settings as it opens the site up for potential DDoS attacks, but it’s better than taking it upon myself to rewrite “admin/controller/catalog/option.php” 🙁

When it’s all said and done, this may not be an OpenCart bug , but it is definitely a design flaw of options administration. The first mention of the issue I found is more than a few years old. OC devs passing blame instead of implementing a simple solution is not uncommon. OpenCart could paginate the option values administration just like they do with every other area where many records are likely to solve this common problem.

Errors that were present prior to applying the above fix (mostly for people searching this topic)…

Notice: Undefined index: option_value_description in /admin/controller/catalog/option.php
 Warning: Invalid argument supplied for foreach() in /admin/controller/catalog/option.php

Leave a Reply

Your email address will not be published. Required fields are marked *