Is there a maximum allowed number of product variants?

  • Posts: 84
  • Thank you received: 4
  • Hikashop Business
5 years 7 months ago #297049

-- HikaShop version -- : 3.5.1
-- Joomla version -- : 3.8.11
-- PHP version -- : 7.1.20
-- Error-message(debug-mod must be tuned on) -- : HTTP ERROR 500

I am trying to add three different characteristics to a product, each with 11 options. This gives me 1331 variants for this product. (The product is made to order, with different parts in different colors, so a lot of combinations are possible.) Entering these variants is no problem, and the all show up under the product variants in the Joomla administrator back-end. However when I try to load this product on the front end of the website, I receive a HTTP ERROR 500 message.
I think this has to do with the high number of product variants, because when I delete a lot of them the product loads just fine and displays all the remaining variant options in three drop down menus as I want it to. (I have not been able to pinpoint the amount of variants at which this issue starts to appear.)

Is there a maximum to the number of allowed product variants as it seems there is? If so, why is the number of options limited, and can something be done about it, or is there another way for me to make this product available with all the color options?

Last edit: 5 years 7 months ago by Foxworks.

Please Log in or Create an account to join the conversation.

  • Posts: 81484
  • Thank you received: 13062
  • MODERATOR
5 years 7 months ago #297059

Hi,

There is no limit in HikaShop. However, HikaShop has to run a lot of MySQL queries (for each variant, it has to load the prices, the images, the files, etc). That's like having a products listing with 1331 products all displayed on the same page.
So it requires a lot of resources from the server. First, it needs time to run all the MySQL queries and load all the data from the database and second, it requires a lot of memory to be able to load that data in the PHP memory.
So you must hit the "max_execution_time" and/or the "memory_limit" settings of your server's php.ini configuration file.

So you have two things you can try:
- increase these on your server (you might need to ask your hosting). However, if the page requires a minute to load, that's not viable and not much can be done to optimize that.
- reduce the number of variants. For example, if one of the characteristics is a color selector and that the quantity and the price don't change based on the selected color, then you don't need to use a characteristic for that selector. Instead, you can create a custom field of the table "item" via the menu Display>Custom fields. A custom field does generate variants and thus doesn't require much resources from the server as basically HikaShop just needs to load the data of the field. And there is no problem in having a mix of characteristics and custom fields.

The following user(s) said Thank You: Foxworks

Please Log in or Create an account to join the conversation.

  • Posts: 84
  • Thank you received: 4
  • Hikashop Business
5 years 7 months ago #297126

Thank you for your quick reply Nicolas. All color combinations are the same price, so adding the color choices as custom fields worked like a charm. :)

Please Log in or Create an account to join the conversation.

Time to create page: 0.542 seconds
Powered by Kunena Forum