New Shipping Plugin Worked but Caused all add to cart and page loading slow

  • Posts: 347
  • Thank you received: 7
  • Hikashop Business
2 months 3 weeks ago #305204

-- HikaShop version -- : 4.0.3
-- Joomla version -- : 3.8
-- PHP version -- : 5.6
-- Error-message(debug-mod must be tuned on) -- : Slow Response

We developed a new shipping plugin and confirm it is working as it return all the required shipping charges and method

But after it is enabled and running, all the "add to cart" action become slow response (5 seconds & more delays) including checkout process

Is there any error in our code cause this ?

attached for your reference

File Attachment:

File Name: easyparcel2.0.zip
File Size:4 KB

Attachments:

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

  • Posts: 66041
  • Thank you received: 9666
  • MODERATOR
2 months 3 weeks ago #305211

Hi,

You're missing the attribute:
var $use_cache = true;
in your plugin's class. If you check all the shipping plugins in HikaShop (besides the manual, which doesn't require caching), they all have that line. This activates the caching for the shipping plugin so that the system only asks the shipping plugin for the shipping methods when something changes in the cart.
If won't solve all the slow loadings as your plugin still has to contact the shipping gateway to get the fees calculated, but it will at least remove all the ones that can be removed.
Now you should check the ping between your test server and the shipping gateway server.
Finally, note that it will do the request to the shipping gateway once for each shipping method you have configured for that shipping plugin (and same for other shipping plugins like UPS, USPS, Fedex, etc). So the more shipping methods you have requiring such connection to shipping gateways, the more it will take time and slow down the page loading.

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

Time to create page: 0.054 seconds
Powered by Kunena Forum