Magento-slow-add-to-cart-feature-image

9+ Pro Tips to Fix Magento 2 Add To Cart Slow That You Should Know!

by Charlie Ly

When shopping online, have you ever met Magento 2 Add to cart slow status and felt bothered about that? This state is a usual problem for lots of websites.

Both Magento 1 & 2 are technologies, and that’s why they have flaws just like any other technology in the market. In order to fix the limitations, the Magento community has battled with various tools, and within them, we can count cache management, profiling, and bottleneck fixes.

However, for the Magento 2 Add to Cart slow, most common users and developers would immediately turn to cache management in the hope of negating the sudden performance drop.

But, cache management doesn’t resolve the problems of website speed. It’s a misconception developer often has, but the cache is not equal to speed. Cache management is a great tool for Magento 2 to fix other problems that arose, such as cache swelling, file fetching, and content delivery. But managing cache doesn’t boost your store speed.

There is also another reason why Magento 2 doesn’t cache shopping carts both the Magento 2 Add to Cart and Cart View need to stay dynamic during the whole process of user experience. Users need to constantly be able to apply discount codes, change carriers and delivery methods, etc.

magento-adding-to-cart-slow-problem

9 Tips That Will Speed Up Your Magento 2 Add To Cart Slow

Here are some facts about why you want your cart process to go faster:

  • 46% of customers said checkout speed is a defining factor of whether or not they will return or recommend them to their friends.
  • The shopping cart abandonment is losing retailers $18 million annually.

Could these numbers motivate you to speed up your Magento add to cart?

There are a number of possibilities for why things could go wrong: template inefficiencies, extension becoming stagnate, non-optimal server configs, resource allocation, etc. In order to know what to fix, you have to have the right analyzing tools. If you want to know some tricks that would help you improve your site’s speed, then continue reading.

CLICK NOW and get the secrets about Magento website speed optimization under your fingertips!

1. Determine which part of the store creates the bottleneck

If you want to find the bottleneck that is causing your Magento 2 Add to Cart slow, you need to perform a performance test on different parts of the store. Although you should remember that web hosting infrastructure is the backbone that determines your store’s speed. The hardware has an important role in forming the foundation of what you can expect from your store.

magento-2-add-to-cart-performance-test

Then what is the solution to know how a store runs poorly, how could you compare? Simple. By setting a clone store with Magento default, and letting it run as a test. If the store runs poorly, then you have found your bottleneck that needs to be fixed. However, it depends on your business strategies and which criteria you want to perform tests on, you can also perform the test directly on the product environment.

In case you need to test the capabilities of your hardware or create a performance benchmark to see how your site will perform if you increase certain parameters, then you can generate more sample products and categories to reflect your real-life store by following the Generate Data for Performance Testing Guide and Performance Test Toolkits provided in DevDocs.

Depending on your goals in enhancing the performance, there can be two solutions to implement for your problem:

  • Upgrade to a better hosting plan, or;
  • If the hardware is already powerful, then fix the server configurations.

If the demo Magento store runs fine, then you might want to look at the code to see if there is an issue.

When fixing the underlying problems for Magento add to cart very slow, you can start with profiling the cart using Magento 2 built-in profiler, which is used to identify the performance trouble in your server.

Magento 2 Profiler supports three formats:

  • HTML
  • CSV file
  • Firebug

Magento Profiler is disabled by default and in order to enable the profiler, using the .htaccess file. State the following statement:

SetEnv MAGE_PROFILER <type>

The <type> can be “csvfile” or “firebug” or “html”.

In the case of “csvfile”, you can find the report in var/log/ dir.

The second way you can enable the profiler is through using CLI. Run the following command:

php bin/magento dev:profiler:enable <type>

where, <type> can be “html” or “csvfile” or “flagfile”.

In the case of “flagfile”, a flagfile named as profiler.flag will be created inside var/ directory.

Note: If you don’t state the <type> and runs the command, the system will put “html” by default.

Profiling works nicely to solve your Magento slow add to cart problem if the bottleneck is within a database table, third-party extension, some rogue scripts, or in a piece of content. The tip for working with the load table is you can sort by time and see which has the largest value in Time and Cnt column.

magento-add-to-cart-very-slow-magento-profiler-table

2. Speed up the inventory management

When a customer adds an item to the cart, Magento must first check to see if this item is still available. This checking is important because two or more buyers can all aim at a limited product at the same time.

The checking in the inventory management section is when Magento looks up the availability of the product from a specific database table, and then changes product quantity values according to customer actions in the store. If the looking up process takes a longer time, then Magento adding to cart will be slower.

In order to fix Magento 2 adding to cart slow problem by inventory management, there are two approaches that we can consider:

  • Shorten the database to speed up the lookup time, or;
  • Disable Magento inventory management to enhance Magento 2 Add to Cart performance (This approach is not recommended because you can have trouble managing your products and orders on your website. You should only apply it in case your products don’t require stock management: downloadable products, etc.)

magento-slow-add-to-cart-inventory-management

3. Disable the unnecessary carrier

Fetching carriers is time-consuming, because other than the exceptions of Flat Rate and Free Shipping, the system will have to send a request to your carrier and wait for a response. Which then causes your customers to have to wait further before they can act.

Disabling some of the carriers that are unnecessary for you will resolve your Magento 2 add to cart slow problem by 1 – 2 seconds, without requiring you to put in a single line of code. In order to remove the carrier you don’t need, go to the admin panel in the backend, and choose store> Configuration.

In the Configuration setting, go to Sale > Shipping Method. You can then disable the carriers that you don’t need or don’t work with anymore.

magento-speed-up-add-to-cart-disable-shipping-carrier
magento-speed-up-add-to-cart-shipping-methods

READ THIS GUIDE NOW and know all about Setting up Magento 2 Shipping Methods in an INSTANT!

4. Remove estimated shipping to simple your cart page

The Estimated Shipping is a useful tool on your cart page to show your customer their expected shipping price. But if it becomes a burden for your cart to move to checkout, then you have to consider removing it. This can help lighten the heavy load that your server has to carry if you are having a lot of functions and can balance it right.

magento-speed-up-add-to-cart-remove-estimate-shipping

The DevDocs for Magento 2.3 does include a guide on how to customize Checkout steps, which you will need to create a file <your_module_dir>/view/frontend/layout/checkout _ index _ index.xml in your custom module directory (remember to do the customization through a form of module override, not changing Magento Core directly).

Although the guide provides general configs for removing a component, we want to remove the specific Knockout component within the cart shipping block.

The common disable of a component instruction would be:

<item name="%the_component_to_be_disabled%" xsi:type="array">
    <item name="config" xsi:type="array">
        <item name="componentDisabled" xsi:type="boolean">true</item>
    </item>
</item>

And then, according to Onilab, for our needs, the code will be modified to:

<referenceBlock name="checkout.cart.shipping">
    <arguments>
        <argument name="jsLayout" xsi:type="array">
            <item name="components" xsi:type="array">
                <item name="block-summary" xsi:type="array">

                    <!-- My custom part: -->

                    <item name="config" xsi:type="array">
                        <item name="componentDisabled" xsi:type="boolean">true</item>
                    </item>
                </item>
            </item>
        </argument>
    </arguments>
</referenceBlock>

Aside from customizing in your checkout _ index _ index.xml file, you will also need to remove the following lines located in the checkout/cart/shipping.phtml. However, it is not ideal for you to change the internal code as you could risk a chance of not being able to recover its original state, create bugs in your platform, or vulnerable your shop’s site to security threats. Instead, you can override the template in your custom module/theme and remove the lines here. If you do not complete this step, you will still see the heading of the Shipping Estimation block:

<div class="title" data-role="title">
    <strong id="block-shipping-heading" role="heading" aria-level="2">
        <?php /* @escapeNotVerified */ echo $block->getQuote()->isVirtual() ? __('Estimate Tax') : __('Estimate Shipping and Tax') ?>
    </strong>
</div>

5. Remove the unused shopping cart rule

Sometimes, when your business grows big, you need many promotions and discount price rules to attract customers. But big loads of cart price rules can accidentally burden the cart speed and lower your cart page performance. So, a simple trick that you could do is remove the cart price rule that you do not use, which slows the Magento Cart and Checkout process.

To delete a cart price rule, go to Marketing > Cart Price Rules, click on one of the price rules from the grid, then press Delete on the Cart Price Rule edit page.

remove-cart-price-rules-magento-speed-up-add-to-cart

GET OVER your confusion about Magento 2 Cart Price Rules in ONE CLICK!

6. Disable minimum advertised price in advanced sales

Getting rid of complicated pricing rules will relieve your Magento cart from pressure, as they have one less thing to check, hence, resolving your Magento add-to-cart slow problem.

One of the values that the stores rarely use is Minimum Advertised Price (MAP), which doesn’t allow people to sell a product at a lower price than the manufacturer recommended (also known as MSRP).

The majority of stores these days have already applied that law when they set the price for products before putting it on their website. Therefore, unless you allow other small retailers to do business on your website, and are not sure what price they will set, you can safely turn off the MAP by going to Stores > Configuration > Sales > Sales.

magento-add-to-cart-slow-disable-minimum-advertised-price

7. Optimize or uninstall the extensions that are causing you backlogs

As you add more extensions, your Magento website will perform much slower. It is understandable as the system has to run through the database of custom modules aside from running interaction on the website alone. For Magento to add to cart slow problems, it was affected by cart-related extensions, like cart view, comment in cart, etc.

There are two options for you to fix the Magento 2 add to cart slow situation caused by extensions. The hard way is you can try to optimize the existing extensions, in which case we recommend finding a module creation & customization service to help you with. Reviewing and refactoring an unfamiliar code is a trivial task even for experienced developers.

ORDER NOW our Create & Customize custom modules service for your business to TAKE flight!

magento-2-module-optimization-to-fix-magento-adding-to-cart-slow

The second way, which is easier, but it will be a trade-off if your Magento 2 Add to Cart needs the function that the module brings: convenience or performance. You can disable the extensions for good, and try to look for alternatives in the marketplace that don’t affect much on your Cart performance, or some extension that somehow bypasses a few steps in the adding to cart process and make the store performance feels faster to your customer. If you’re inclined to go with the second option, then read the later sections in this post.

8. Truncate your magento database

If you have done all 7 things above and none helped, it’s time to try to dive into your database.

Over time, your massive database can get slower and slower, and one of the solutions you can utilize is backup and truncate your table. When your store gets big, there will be tons of entries that no longer hold value, which means you are free to get rid of them.

Here is the list of tables that you need to closely investigate, backup, and truncate:

  • dataflow_batch_export,
  • dataflow_batch_import,
  • log_customer,
  • log_quote,
  • log_summary,
  • log_summary_type,
  • log_url,
  • log_url_info,
  • log_visitor,
  • log_visitor_info,
  • log_visitor_online,
  • report_viewed_product_index,
  • report_compared_product_index,
  • report_event,
  • index_event,
  • Catalog_compare_item.

9. Review all add to cart event that slows the page down

magento-2-add-to-cart-review-all-event

Now, after you have done all but the page is still slow, then you have to turn back to Magento profiling to examine carefully all events that happen after the customer hits the Magento 2 Add to Cart button. Some of the slowdowns you can catch using other performance monitoring applications aside from Magento Profiler.

And if you are still stuck after this stage, then you should ask for a professional agency service for help.

SQUASH all your Magento 2 website problems with Code Auditing and Magento 2 Website Maintenance!

Top 3+ Extensions to Speed Up Your Add to Cart Process

Aside from speeding up Magento 2 Add to Cart slow by resolving database redundant, it’s possible to use modules to bypass a few steps in the add to cart process, which would improve your store’s performance. Your customers find it’s troublesome to go through many pages to add a product to cart, and there are plenty of extensions out there that will “cheat” Magento 2 Add to Cart slow speed for you.

We’ve listed down below some extensions that would relieve the load off your site’s database, skip the steps in adding to cart, or let customers experience the faster and more efficient add to cart step.

Magento 2 Ajax Add to Cart by BSSCommerce

Ajax-Cart

Magento 2 Ajax Cart gives your customers a faster Magento 2 Add to Cart performance feeling because it relies on smooth operation and an appealing interface. When customers press the add to cart button, there will be a popup announcing that the order has been put into cart, and showing some related products that they might want to consider. Your customer can also decide whether to view their cart or continue shopping.

READ MORE >> Magento 2 Ajax Add To Cart: Speed Up Purchases Now

magento-add-to-cart-slow-extension

The extension creates a sense of continuous shopping and lets customers view the product right in the popup, which reduces page loading time, reduces the time for adding to the cart. All actions are done on one page only.

Not only that, but it also promotes related products, cross-sells, and up-sells to customers when they’re most willing to spend a little more for an extra item on their cart.

Adding more features you might be interested in are:

  • You can style the pop-up so that it suits and matches your website’s theme
  • This extension works well with all types of products: simple/configurable/bundle/grouped/downloadable products
  • Multi-position to display the popup after adding to cart: Product Page, Catalog Page, Search Result Page
  • Limit the time to display the popup 
  • Easily config elements in the Ajax cart Magento 2 popup.

Magento 2 Customer Groups Shipping and Payment Method by BSSCommerce

When a customer adds a product in the frontend, Magento has to fetch the Shipping and Payment Method, which causes more time waiting before your customers can take action.

The frustration increases when they wait for the shipping and payment methods that are not reserved for their customer group to load. This will ultimately lead to them abandoning the cart and not returning.

The Magento 2 Shipping and Payment Method per Customer Group is the right solution for you.

shipping-and-payment-method-per-customer-group-m2

It restricts shipping and payment methods for a specific group of customers, and you can adjust the change in the backend with some easy steps.

Now your customers will only have to wait for the correct payment and shipping for their group, and it takes loads of work out for Magento 2, which means the speed of Magento 2 Add to Cart is improved.

magento-slow-add-to-cart-shipping-and-payment-methods-extension

shipping-and-payment-method-per-customer-group-frontend

About the compatibility, this module does not make you disappear because it is compatible with integrated payment methods like Braintree and iDEAL & Giropay via Stripe. Besides that, it also works well with Magento 2’s default shipping restrictions and payment features.

Magento 2 Add Multiple Products to Cart by BSSCommerce

add-multiple-products-to-cart-m2

The Magento 2 Add Multiple Products to Cart extension doesn’t speed up adding a single product to the cart. Still, it makes a significant improvement if your customer wants to add many effects to their cart at a time. No need to go to all the product pages and add products one by one, customers can add all the products they need by ticking the checkboxes that appear before the products and clicking on Adding All products to the cart.

magento-speed-up-add-to-cart-multiple-products-checkboxes

magento-adding-to-cart-slow-fix-extension

The integrated Ajax popup is an additional function of this extension that can also enhance customers’ experience in Magento 2 Add to Cart. It allows customers to choose the product attribute right in the popup form, and they can prefer to view the cart or continue shopping afterward.

Like the Magento 2 Ajax Add to Cart extension, this module also works for various product types. But there is an advanced feature that you can restrict the customer group to. That means store owners can choose customer groups to apply the module to depending on their sales campaign.

The product is the best choice for you because you have a 2-in-1 solution for your Magento add-to-cart prolonged problems, which deals with both the cases you need to add multiple and a single product into the cart.

magento-add-to-cart-very-slow-optimize-extension-pop-up

Magento 2 Enhanced Quick Cart by Weltpixel

This extension minimizes the add-to-cart process and takes customers directly to the checkout steps, and they can view the cart through a mini window that slides out in a form similar to a mini cart.

It also provides a responsive design, and you can customize the design right from admin options; no code is needed.

magento-2-add-to-cart-extension-quick-cart

In Conclusion

With your Magento store growing big and running a massive database of products, there is no way to avoid your Magento 2 Add to Cart being sluggish and slow to respond. And while investigating your cart performance, remember that there can be plenty of ways to determine the origin of your cart speed drop.

We have covered some tips to help you troubleshoot your problems, but even when your cart runs smoothly, there are still some extensions that aid your back to further bump your business to the next stage of customer experience. Don’t hesitate to contact us if you still have trouble with your Magento cart even after applying everything because you don’t have to fight this alone.

You can also CHECK >>> Magento ecommerce extensions both free and paid for maximize your online store capabilites.

Next Reading Suggestions

© 2019 BSS Commerce owned by THANH CONG INTER ., JSC. All Rights Reserved.
Business registration certificate no. 0106064469 issued by Hanoi Department of Planning and Investment on 19 December 2019.
Legal Representative: Mr. Nguyen Quang Trung.