[Skip to main content](#vessel-content)

#   Loading speed with variations (resolved)

##

- **[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")**
- [![esotechie's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7143.jpg)](/forum/user/7143-esotechie "View esotechie's Profile") Topic Author
- [ Offline](/forum/user/7143-esotechie)

Less More

- Posts: 180
- Thank you received: 13
-
-
-
- [](http://www.halare.co.uk/)
-

14 years 4 months ago -  14 years 4 months ago [\#54810](#54810) by [esotechie](/forum/user/7143-esotechie "View esotechie's Profile")  *[Loading speed with variations (resolved)](/forum/2-general-talk-about-hikashop/54810-loading-speed-with-variations-resolved#54810 "Categories and product listings pages load with speed as you would expect.  When loading a page with a large number of variations, (3 colour and 7 sizes) the product page takes over 5 seconds to load, and this is running local (i am using MAMP for development).  Caching and ZIP are both one, and as I have said the rest of the site, including the pages from Hikashop that are not the product page load with speed.  It can not be image creation (e.g. creating thumbnails) as they have already been done on the first visit to the page.  I am baffled about the speed and rather worried about it's implications.  Any advice or feedback would be appreciated.")* was created by *[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")*

Categories and product listings pages load with speed as you would expect.

When loading a page with a large number of variations, (3 colour and 7 sizes) the product page takes over 5 seconds to load, and this is running local (i am using MAMP for development).

Caching and ZIP are both one, and as I have said the rest of the site, including the pages from Hikashop that are not the product page load with speed.

It can not be image creation (e.g. creating thumbnails) as they have already been done on the first visit to the page.

I am baffled about the speed and rather worried about it's implications.

Any advice or feedback would be appreciated.

Last edit: 14 years 4 months ago by [esotechie](/forum/user/7143-esotechie "View esotechie's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzU0ODEwLWxvYWRpbmctc3BlZWQtd2l0aC12YXJpYXRpb25zLXJlc29sdmVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")**
- [![esotechie's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7143.jpg)](/forum/user/7143-esotechie "View esotechie's Profile") Topic Author
- [ Offline](/forum/user/7143-esotechie)

Less More

- Posts: 180
- Thank you received: 13
-
-
-
- [](http://www.halare.co.uk/)
-

14 years 4 months ago [\#54811](#54811) by [esotechie](/forum/user/7143-esotechie "View esotechie's Profile")  Replied by *[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")* on topic *[Re: Loading speed with variations](/forum/2-general-talk-about-hikashop/54810-loading-speed-with-variations-resolved#54811 "Categories and product listings pages load with speed as you would expect.  When loading a page with a large number of variations, (3 colour and 7 sizes) the product page takes over 5 seconds to load, and this is running local (i am using MAMP for development).  Caching and ZIP are both one, and as I have said the rest of the site, including the pages from Hikashop that are not the product page load with speed.  It can not be image creation (e.g. creating thumbnails) as they have already been done on the first visit to the page.  I am baffled about the speed and rather worried about it's implications.  Any advice or feedback would be appreciated.")*

Hmmm. I did a bit more testing switching things on and off and it seems to slow right down with "Display vote in products page" turned on. Turn off and the page loads in 3 seconds, which even though is slower than I would like, considerably better.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzU0ODEwLWxvYWRpbmctc3BlZWQtd2l0aC12YXJpYXRpb25zLXJlc29sdmVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")**
- [![esotechie's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7143.jpg)](/forum/user/7143-esotechie "View esotechie's Profile") Topic Author
- [ Offline](/forum/user/7143-esotechie)

Less More

- Posts: 180
- Thank you received: 13
-
-
-
- [](http://www.halare.co.uk/)
-

14 years 4 months ago [\#54844](#54844) by [esotechie](/forum/user/7143-esotechie "View esotechie's Profile")  Replied by *[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")* on topic *[Re: Loading speed with variations](/forum/2-general-talk-about-hikashop/54810-loading-speed-with-variations-resolved#54844 "Categories and product listings pages load with speed as you would expect.  When loading a page with a large number of variations, (3 colour and 7 sizes) the product page takes over 5 seconds to load, and this is running local (i am using MAMP for development).  Caching and ZIP are both one, and as I have said the rest of the site, including the pages from Hikashop that are not the product page load with speed.  It can not be image creation (e.g. creating thumbnails) as they have already been done on the first visit to the page.  I am baffled about the speed and rather worried about it's implications.  Any advice or feedback would be appreciated.")*

Some more information from my testing:

The bottleneck is in the file administrator-&gt;components-&gt;com_hikashop-&gt;classes-&gt;product.php

and the part of the code causing the slow load is:
Code:

if(isset($element-&gt;$field) &amp;&amp; is_array($element-&gt;$field) &amp;&amp; count($element-&gt;$field)){ $array=array(); foreach($element-&gt;$field as $k =&gt; $v){ $array[$k] = (PHP_VERSION &lt; 5) ? $v : clone($v); } $variant-&gt;$field=$array; }else{ if($field=='product_name'){ $config =&amp; hikashop_config(); if(!empty($variant-&gt;characteristics)){ $separator = $config-&gt;get('characteristics_values_separator',' '); foreach($variant-&gt;characteristics as $val){ $variant-&gt;characteristics_text.=$separator.$val-&gt;characteristic_value; } } }else{ $variant-&gt;$field = @$element-&gt;$field; } }

I believe it is the line $variant-&gt;$field = @$element-&gt;$field; that does the most damage. Looking at the products it is the text in the description which is making it slow, reducing the description to a couple of words makes it fast. This means that any product with multiple variations and large text, are slow to load, which is not great.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzU0ODEwLWxvYWRpbmctc3BlZWQtd2l0aC12YXJpYXRpb25zLXJlc29sdmVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

14 years 4 months ago [\#54930](#54930) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Loading speed with variations](/forum/2-general-talk-about-hikashop/54810-loading-speed-with-variations-resolved#54930 "Categories and product listings pages load with speed as you would expect.  When loading a page with a large number of variations, (3 colour and 7 sizes) the product page takes over 5 seconds to load, and this is running local (i am using MAMP for development).  Caching and ZIP are both one, and as I have said the rest of the site, including the pages from Hikashop that are not the product page load with speed.  It can not be image creation (e.g. creating thumbnails) as they have already been done on the first visit to the page.  I am baffled about the speed and rather worried about it's implications.  Any advice or feedback would be appreciated.")*

Hi,

Yes, as you can set a different description for each variant of a product, that code helps the system fill the default description of the main product for variants without a description (and that's the same for all the other fields in fact).

As a quick fix, you can disable the copy of the description here, and remove the div display variants description in the "show" file of the "product" view.

As a long term solution, we would have to optimize the code so that if none of the variants have a value for a field, we could just not copy the data to the variants and skip the display of the variants value for that field.
That would have the double benefit to reduce the page size and improve a bit the number of characteristics/variants a product could have before crashing (a few hundred variants at the moment for a normal server).

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzU0ODEwLWxvYWRpbmctc3BlZWQtd2l0aC12YXJpYXRpb25zLXJlc29sdmVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")**
- [![esotechie's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7143.jpg)](/forum/user/7143-esotechie "View esotechie's Profile") Topic Author
- [ Offline](/forum/user/7143-esotechie)

Less More

- Posts: 180
- Thank you received: 13
-
-
-
- [](http://www.halare.co.uk/)
-

14 years 4 months ago [\#54934](#54934) by [esotechie](/forum/user/7143-esotechie "View esotechie's Profile")  Replied by *[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")* on topic *[Re: Loading speed with variations](/forum/2-general-talk-about-hikashop/54810-loading-speed-with-variations-resolved#54934 "Categories and product listings pages load with speed as you would expect.  When loading a page with a large number of variations, (3 colour and 7 sizes) the product page takes over 5 seconds to load, and this is running local (i am using MAMP for development).  Caching and ZIP are both one, and as I have said the rest of the site, including the pages from Hikashop that are not the product page load with speed.  It can not be image creation (e.g. creating thumbnails) as they have already been done on the first visit to the page.  I am baffled about the speed and rather worried about it's implications.  Any advice or feedback would be appreciated.")*

Thanks for the reply Nicolas. Clear answer.

I'll have to wait and judge it on a project basis on :
1) if variants have different values
2) the size of the data

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzU0ODEwLWxvYWRpbmctc3BlZWQtd2l0aC12YXJpYXRpb25zLXJlc29sdmVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")**
- [![esotechie's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7143.jpg)](/forum/user/7143-esotechie "View esotechie's Profile") Topic Author
- [ Offline](/forum/user/7143-esotechie)

Less More

- Posts: 180
- Thank you received: 13
-
-
-
- [](http://www.halare.co.uk/)
-

14 years 4 months ago [\#55024](#55024) by [esotechie](/forum/user/7143-esotechie "View esotechie's Profile")  Replied by *[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")* on topic *[Re: Loading speed with variations](/forum/2-general-talk-about-hikashop/54810-loading-speed-with-variations-resolved#55024 "Categories and product listings pages load with speed as you would expect.  When loading a page with a large number of variations, (3 colour and 7 sizes) the product page takes over 5 seconds to load, and this is running local (i am using MAMP for development).  Caching and ZIP are both one, and as I have said the rest of the site, including the pages from Hikashop that are not the product page load with speed.  It can not be image creation (e.g. creating thumbnails) as they have already been done on the first visit to the page.  I am baffled about the speed and rather worried about it's implications.  Any advice or feedback would be appreciated.")*

Sorry Nicolas but I can not see what I need to change in the file administrator-&gt;components-&gt;com_hikashop-&gt;classes-&gt;product.php to disable the variant description loads but still have the main product description to show. If I comment out $variant-&gt;$field = @$element-&gt;$field;, not description appears.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzU0ODEwLWxvYWRpbmctc3BlZWQtd2l0aC12YXJpYXRpb25zLXJlc29sdmVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

14 years 4 months ago [\#55065](#55065) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Loading speed with variations](/forum/2-general-talk-about-hikashop/54810-loading-speed-with-variations-resolved#55065 "Categories and product listings pages load with speed as you would expect.  When loading a page with a large number of variations, (3 colour and 7 sizes) the product page takes over 5 seconds to load, and this is running local (i am using MAMP for development).  Caching and ZIP are both one, and as I have said the rest of the site, including the pages from Hikashop that are not the product page load with speed.  It can not be image creation (e.g. creating thumbnails) as they have already been done on the first visit to the page.  I am baffled about the speed and rather worried about it's implications.  Any advice or feedback would be appreciated.")*

You need to remove that line yes. And as I said in my message, you also need to remove the div display variants description in the "show" file of the "product" view. That way the system will always use the description of the main product.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzU0ODEwLWxvYWRpbmctc3BlZWQtd2l0aC12YXJpYXRpb25zLXJlc29sdmVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")**
- [![esotechie's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7143.jpg)](/forum/user/7143-esotechie "View esotechie's Profile") Topic Author
- [ Offline](/forum/user/7143-esotechie)

Less More

- Posts: 180
- Thank you received: 13
-
-
-
- [](http://www.halare.co.uk/)
-

14 years 4 months ago -  14 years 4 months ago [\#55120](#55120) by [esotechie](/forum/user/7143-esotechie "View esotechie's Profile")  Replied by *[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")* on topic *[Re: Loading speed with variations](/forum/2-general-talk-about-hikashop/54810-loading-speed-with-variations-resolved#55120 "Categories and product listings pages load with speed as you would expect.  When loading a page with a large number of variations, (3 colour and 7 sizes) the product page takes over 5 seconds to load, and this is running local (i am using MAMP for development).  Caching and ZIP are both one, and as I have said the rest of the site, including the pages from Hikashop that are not the product page load with speed.  It can not be image creation (e.g. creating thumbnails) as they have already been done on the first visit to the page.  I am baffled about the speed and rather worried about it's implications.  Any advice or feedback would be appreciated.")*

Seems the issue was being magnified by the same issue as in my thread [ "Comments and Vote unusable due to speed"](http://www.hikashop.com/forum/2-general-talk-about-hikashop/54888-comments-and-vote-unusable-due-to-speed-resolved.html)

i.e. jQueryEasy.

Have to find an uneasy way to manage jQuery libraries ![:)](/media/kunena/emoticons/3.png ":)")

Last edit: 14 years 4 months ago by [esotechie](/forum/user/7143-esotechie "View esotechie's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzU0ODEwLWxvYWRpbmctc3BlZWQtd2l0aC12YXJpYXRpb25zLXJlc29sdmVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.066 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
