◦ Comprehensive security
◦ 24/7 support
Magento Guide → Cart
Magento shopping cart: How to setup, optimize, and manage
A well-functioning Magento cart isn’t just a convenience—it’s a key part of how your online store makes money. From configuration to performance to promotions, every detail in your cart setup can shape your customer’s experience and determine whether they complete a purchase or bounce.
Let’s walk through everything you need to know about configuring, optimizing, and maintaining your Magento cart the right way.
Host Magento at full throttle.
Get secure, reliable Magento hosting so you can scale faster.
Configure Magento cart settings
Before anything else, you need to configure how your shopping cart behaves. Magento includes a dedicated settings area to help you control things like expiration time, redirection, and minimum order rules.
To access these settings:
- Log in to your Magento Admin Panel.
- Navigate to Stores > Configuration.
- In the left menu, go to Sales > Checkout.
Here’s what each important setting does:
- Quote Lifetime (Minutes): This controls how long a customer’s cart stays active if they don’t complete the checkout. The default is usually 60 minutes, but you can increase this for longer shopping sessions.
- After Adding a Product Redirect to Shopping Cart: If set to “Yes,” the customer will be taken directly to their cart after clicking “Add to Cart.” If set to “No,” they’ll stay on the product page, which helps with browsing.
- Grouped Product Image: Lets you define which image to display for grouped products in the cart (e.g., default or product thumbnail).
- Display Cart Summary: Shows the total number of items and subtotal in the cart icon or side cart.
- Minimum Order Amount: Enforces a required cart total before the customer can check out—helpful for wholesale stores or high-margin products.
Make sure to click Save Config in the upper right when you’re done.
Optimize cart performance
The faster your cart loads, the less likely customers are to abandon it. Magento is a powerful platform, but without a few performance tweaks, the cart and checkout experience can feel sluggish.
Here’s how to make sure your Magento cart performs well:
1. Enable caching
Magento supports Full Page Cache (FPC) and Varnish, which can drastically improve page load times. To enable caching:
- Go to System > Cache Management.
- Ensure that all cache types are set to Enabled (especially Full Page Cache).
- If using Varnish, you can configure it under Stores > Configuration > Advanced > System > Full Page Cache.
2. Use AJAX for Add to Cart
AJAX lets users add products to the cart without waiting for the entire page to reload. Most modern Magento themes include AJAX functionality by default, but you can enhance it with a module like Magento 2 AJAX Add to Cart by Mageplaza.
3. Reduce unused extensions
Every third-party module adds processing time to your store. Disable or remove any extensions you’re not using, especially ones that modify the cart.
- Go to Stores > Configuration > Advanced > Advanced.
- Disable modules from here, or use the command line if needed.
4. Use production mode
Magento has three modes: default, developer, and production. Make sure your live store is running in production mode for faster performance.
To check mode, run:
php bin/magento deploy:mode:showTo set production mode:
php bin/magento deploy:mode:set productionCustomize the cart display and layout
The Magento cart page is highly customizable, which means you can align it with your brand and streamline the customer experience.
Edit the cart template
Magento’s layout files control the structure of your cart. The main cart layout file is:
vendor/magento/module-checkout/view/frontend/templates/cart.phtmlTo make changes without modifying core files:
- Copy the file into your custom theme directory:
app/design/frontend/YourVendor/YourTheme/Magento_Checkout/templates/cart.phtml - Edit the copied file as needed (e.g., reposition product info, add labels, trust badges, or cross-sell offers).
- Clear the cache to see changes.
Add cart messages and promotions
You can add messaging above the cart to notify customers about:
- Free shipping thresholds
- Limited-time discounts
- Coupon reminders
This can be done in cart.phtml or with a CMS Static Block added via Content > Blocks and then positioned using layout XML.
Show or hide prices and taxes
Magento gives you control over which financial information shows up in the cart. Go to Stores > Configuration > Sales > Tax to configure visibility.
You can also choose whether to include/exclude tax from subtotals and totals.
Apply cart price rules for promotions
Cart price rules let you create discounts that apply based on the cart’s contents or user actions. These are perfect for:
- Coupons
- “Buy X, get Y” deals
- Free shipping offers
- Percentage or fixed discounts
To create a cart rule:
- Go to Marketing > Promotions > Cart Price Rules.
- Click Add New Rule.
- Under Rule Information, give your rule a name and set it to Active.
- Choose applicable Websites and Customer Groups.
- Set a Coupon Code if you want it to be used manually.
- Under Conditions, define when the rule applies (e.g., “Subtotal greater than 100”).
- Under Actions, define what the rule does (e.g., “Apply 10% discount”).
- Optionally, define free shipping or stop further rules.
Save the rule, then test it on the frontend.
Enable persistent cart functionality
A persistent cart lets customers keep items in their cart across multiple visits, even if they leave your site or close the browser.
To enable it:
- Go to Stores > Configuration > Customers > Persistent Shopping Cart.
- Set Enable Persistence to Yes.
- Choose whether persistence applies to guests or logged-in users only.
- Set a Cookie Lifetime (e.g., 3600 = 1 hour).
- Choose whether persistence starts only after the user logs in.
This makes shopping more convenient and helps reduce abandoned carts.
Monitor and recover abandoned carts
Magento Open Source doesn’t include built-in abandoned cart emails, but you can still track and recover them.
View abandoned cart reports
- Go to Reports > Marketing > Abandoned Carts.
- You’ll see abandoned carts by customer and time—only for logged-in users.
This is a helpful starting point for identifying drop-offs.
Use recovery extensions
For automated abandoned cart emails, try a module like:
These tools let you create sequences with reminders, discounts, or urgency-based emails.
Secure your cart against spam and abuse
Without basic protection, bots can abuse your cart by mass-adding items or using it to spam checkout forms.
Here’s how to secure it:
1. Enable CAPTCHA
- Go to Stores > Configuration > Customers > Customer Configuration > CAPTCHA.
- Enable CAPTCHA on the registration, login, and checkout forms for guests.
2. Set short cart expiration
If your cart quote lifetime is too long, it may allow bots to lock up inventory. Keep it under 60 minutes unless you have a reason to extend it.
3. Use firewall or rate-limiting tools
Use your hosting provider’s firewall or third-party services like Cloudflare to limit API access and prevent automated abuse.
4. Install security extensions
Security plugins like Mageplaza Security Suite or Amasty Bot Protection can add another layer of protection for your cart and checkout pages.
Magento cart FAQs
Next steps for Magento cart setup and optimization
Your shopping cart is one of the most important parts of your store—it’s where customers make the final decision to buy. Setting it up properly, optimizing for speed, and maintaining strong security are all essential for conversion success.
To get started, configure your core cart settings, then explore performance enhancements like caching and AJAX. Customize the layout to suit your brand, and don’t forget to track abandoned carts or set up promotional cart rules for more revenue.
Ready to upgrade your Magento experience? Professional hosting improves speeds, security, and reliability for a website and a brand that people find engaging and trustworthy.
Liquid Web offers the raw infrastructure power you need with mission-critical features that keep your store running smoothly. Most importantly, our in-house Magento experts are standing by to help with both hosting and Magento application roadblocks.
Click through below to explore all of our Magento hosting options, or chat with an expert right now to get answers and advice.
Ready to get started?
Get the fastest, most secure Magento hosting on the market
Additional resources
What is Magento Ecommerce? →
A complete beginner’s guide to the Magento Ecommerce platform
Magneto vs. WordPress →
Compare pricing, hosting, security, SEO, and a lot more
Best Magento ERP extensions →
Our top 10 compared so you can decide which is best for your business