First of all, I`m sorry if someone else posted a similar issue, but I couldn't find anything.
I have made this post hoping that someone might be able to help me find some kind of fix. My issue is that when I go to the checkout page, it takes an awful lot of time to load. Usually between 30-35 seconds. All the other pages within the site work pretty well, except for this one. I have been searching for a while now, but I wasn't able to find anything to fix this issue, which is very important..
The only clue I found is that the loading takes this much because of the addresses. In the Chrome developer screen, in the network tab, it shows that almost half of the loading time is from "OnePageCheckout" and almost half of the remaining time is from "OpcSaveBilling". Also, if it helps, each time this step is loaded, Chrome processor usage spikes at arount 30%.
Any kind of help or hints regarding this issue will be very appreciated.
1. What version of nopCommerce are you using? 2. How many addresses does your customer record has? 3. Try to register as a new customer. Do you still experience this issue?
The issue is the same, no matter if the customer is new or old. The one i`m testing with has 3 or 4 addresses saved, but the issue is the same even if i checkout as guest or with any other customer.
Yes, the delay is more or less the same on woth checkout options. As for plugins, everything I have is pagespeed insights (the load was the same before I installed it) and ArtFactory theme with its required seven spikes plugins. I checked within them but I was unable to find anything that could help.
Yes, the delay is more or less the same on woth checkout options. As for plugins, everything I have is pagespeed insights (the load was the same before I installed it) and ArtFactory theme with its required seven spikes plugins. I checked within them but I was unable to find anything that could help.
Hi,
You can enable the MiniProfiler to see if it is a server side issue or not. The time to first byte (the time it takes to get the HTML from the server) could also be used to indentify if the slow loading comes from the server or it is some resource that is loading very slowly and slows down the whole page. Please check so that we can advise!
I have enabled miniprofiler but for some reason it does not work on the checkout page. I presume something is blocking some content, as there is a similar problem with some images and content from the top menu that are also not being displayed when in the checkout page.
I have found the reason of the long loading. It's caused by the OpcBillingForm within the checkout controller. That takes about 20 seconds to load, and the OpcSaveBilling takes about 6-7 seconds.
The OpcBillingForm action calls the following method.
protectedvirtual CheckoutBillingAddressModel PrepareBillingAddressModel(int? selectedCountryId = null, bool prePopulateNewAddressWithCustomerFields = false) { var model = new CheckoutBillingAddressModel(); //existing addresses var addresses = _workContext.CurrentCustomer.Addresses //allow billing .Where(a => a.Country == null || a.Country.AllowsBilling) //enabled for the current store .Where(a => a.Country == null || _storeMappingService.Authorize(a.Country)) .ToList(); foreach (var address in addresses) { var addressModel = new AddressModel(); addressModel.PrepareModel(address, false, _addressSettings); model.ExistingAddresses.Add(addressModel); }
I have found the reason of the long loading. It's caused by the OpcBillingForm within the checkout controller. That takes about 20 seconds to load, and the OpcSaveBilling takes about 6-7 seconds.
The OpcBillingForm action calls the following method.
protectedvirtual CheckoutBillingAddressModel PrepareBillingAddressModel(int? selectedCountryId = null, bool prePopulateNewAddressWithCustomerFields = false) { var model = new CheckoutBillingAddressModel(); //existing addresses var addresses = _workContext.CurrentCustomer.Addresses //allow billing .Where(a => a.Country == null || a.Country.AllowsBilling) //enabled for the current store .Where(a => a.Country == null || _storeMappingService.Authorize(a.Country)) .ToList(); foreach (var address in addresses) { var addressModel = new AddressModel(); addressModel.PrepareModel(address, false, _addressSettings); model.ExistingAddresses.Add(addressModel); }