Extremly long execution time when adding a product to the cart

  • Posts: 2
  • Thank you received: 0
5 years 6 months ago #298140

-- HikaShop version -- : HikaShop Business 3.5.1
-- Joomla version -- : 3.8.12
-- PHP version -- : 7.2.0
-- Browser(s) name and version -- : Chrome/Firefox
-- Error-message(debug-mod must be tuned on) -- : When a product will be added to a cart, the afterRender_car method of the mod_hikashop_cart takes ca. 130 s to finish what makes the shopping impossible.

When a product will be added to a cart, the afterRender_car method of the mod_hikashop_cart takes ca. 130 s to finish what makes the shopping impossible.

This message contains confidential information

Attachments:

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

  • Posts: 81363
  • Thank you received: 13037
  • MODERATOR
5 years 6 months ago #298143

Hi,

I see that you're using the old add to cart system of HikaShop 2.x.
So first, turn off the "add to cart legacy" setting of the HikaShop configuration to switch to the new add to cart system in Ajax of HikaShop 3.x. That might help.
Otherwise, looking at the MySQL queries log, I can see that the delay happens between the loading of the discounts for the products in the cart and the loading of the auto loaded coupons for the cart:
monosnap.com/file/2hq6lySOqDBUmfPvARyu4FzBFWIbj4
It's highly likely that this comes from a plugin which is triggered with the onAfterCartProductsLoad event.
Also, it's possible that this comes from a connection to a distant server timing out.
For example, when the UPS shipping plugin tries to connect to the UPS server but fails because your hosting kills the request (due to strict firewall rules), the UPS shipping plugin has to wait until the timeout before it can give back the hand to HikaShop telling it that it couldn't get any shipping rate calculated.
I don't think that it comes from that plugin since it doesn't implement that onAfterCartProductsLoad trigger.
But I suspect that you might have a similar issue with another plugin which also requires connecting to something else. Maybe a tax calculation plugin, like Taxcloud, or a custom plugin. I don't know.
You would have to check the different plugins enabled in the groups hikashop, hikashoppayment, hikashopshipping and system of your website. Try to disable them one by one and testing each time to find the culprit.

The following user(s) said Thank You: tedgar

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

  • Posts: 2
  • Thank you received: 0
5 years 6 months ago #298220

Hi,

you were right, it came from a 3rd party payment plugin that was trying to connect to a remote server. It would be great if you would consider adding some mechanism, that would prevent such kind of issues.
Thank you!

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

  • Posts: 81363
  • Thank you received: 13037
  • MODERATOR
5 years 6 months ago #298221

Hi,

That's indeed a good idea.
Unfortunately, once the plugins trigger is sent to Joomla by HikaShop, HikaShop has no control on which plugin is triggered (it's Joomla which does that), which one was slow or fast, etc.
That's an idea that should be brought up with Joomla's core so that the debug system could also log the timings of each event being triggered for each plugin implementing the event.

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

Time to create page: 0.047 seconds
Powered by Kunena Forum