Magento 2 products not being added to cart

Magento 2 products not being added to cart

July 27, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento 2 products not being added to cart

Magento 2: Troubleshooting “Adding…” Issue on Add to Cart Button

If you’re experiencing issues where the “Add to Cart” button changes to “Adding…” but doesn’t actually add products to your cart in Magento 2, you’ve come to the right place. Let’s dive into this common issue and explore some effective solutions.

Understanding the Problem: A Developer’s Perspective

When you click the “Add to Cart” button on a product page, several processes occur behind the scenes:

  1. The client-side JavaScript handles the form submission.
  2. Data is sent via AJAX to the server.
  3. The server processes this data and adds the item(s) to your cart.

If any of these steps fail or are disrupted, you’ll see the “Adding…” message stuck on the button without any further action being taken.

Common Causes and Solutions

1. JavaScript Errors or Conflicts

JavaScript errors can prevent the AJAX form submission from happening. To check for errors:

  • Enable Magento 2’s built-in client-side logging. Go to Stores > Configuration > Advanced > Developer > Debug.
  • Set “Enable Client Log” and “Enable Add to Cart Log” to yes.

Ensure there are no JavaScript errors reported in the console log. If you find conflicts, review your custom JavaScript files or extensions for compatibility issues with Magento 2’s core scripts.

2. Incorrect Form Keys

The form key is a security measure that validates each request. If it’s incorrect or missing, the server won’t process the cart addition.

Check if the form_key value in your template file matches the one generated by Magento:

<form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" enctype="application/x-www-form-urlencoded">
    <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
</form>

Ensure the form key generated matches the one displayed in the template.

3. Incorrect or Missing Permissions

If your product is a custom or configurable item, ensure you have set up the correct permissions for adding it to the cart:

  • Check if your catalog rules allow the product’s addition.
  • Verify that the stock status is set to “In Stock”.
  • Ensure the price display settings and tax calculations are configured correctly.

Best Practices for Magento 2 Cart Additions

  1. Minimize Customizations: The more you customize, the higher the chance of conflicts or compatibility issues.

  2. Update Regularly: Keep your Magento version up-to-date to benefit from bug fixes and performance improvements.

  3. Use Official Extensions: Stick to reputable extensions from Magento Marketplace to minimize potential conflicts.

Conclusion: Resolving the “Adding…” Stuck Issue

Remember, Magento 2 is a complex system with many moving parts. When troubleshooting cart addition issues:

  • Always start by enabling debugging and checking logs for error messages.
  • Inspect your custom code for compatibility issues or syntax errors.
  • Verify configuration settings at every level—product, category, store view, and global.

By following these steps and taking a systematic approach, you can usually pinpoint the cause of the “Adding…” stuck issue. Don’t hesitate to reach out to Laravel Company for expert guidance tailored to your specific setup.

Happy troubleshooting!

Magento 2 Checkout Catalog Security

Our network