Auto-Open on Add to Cart
The side cart opens by itself when a shopper adds a product, so they can see it worked and head to checkout.
ShapedCart's auto-open feature opens the WooCommerce side cart the moment a shopper adds a product to their cart, with the new item already in it. It's switched on by default, with the Auto-open on add setting at ShapedCart → Side Cart → 1 Side cart → General → Basic Settings. See Auto-open on add.
This page explains how it works with each kind of add-to-cart button, and which WooCommerce settings can get in its way.
How it works
ShapedCart opens the side cart after every successful add to cart, whichever kind of button the shopper uses. It only opens once WooCommerce confirms the product is in the cart, so it never opens for an add that failed, for example because the product is out of stock.
| Where the shopper adds a product | What happens |
|---|---|
| Shop, category and search pages (the "Add to cart" buttons under each product) | The product is added without leaving the page, and the cart slides open. |
| A single product page, for simple, variable and grouped products | The page reloads, as it always does in WooCommerce, and the cart opens as soon as the page loads, with the product in it. |
| WooCommerce product blocks, like the buttons in a Product Collection block | The product is added without leaving the page, and the cart slides open. |
| Quick view popups from other plugins | If the plugin uses WooCommerce's own add-to-cart scripts, which most do, the cart opens just like on a shop page. |
On a single product page you may also see WooCommerce's usual "Product has been added to your cart" message at the top of the page, behind the cart. That's normal. It comes from WooCommerce, not ShapedCart.
Variable products work too
A variable product, one where shoppers pick a size or color, can only be added from its product page. WooCommerce handles that with a full page reload, so there's no "add to cart" event for plugins to listen to. ShapedCart asks WooCommerce directly whether a product was just added, and opens the cart once the page has loaded. You don't need any extra setup for this.
Turning it off
To stop the cart opening by itself, switch off ShapedCart's Auto-open on add setting at ShapedCart → Side Cart → 1 Side cart → General → Basic Settings, then click Save changes.
With auto-open off, adding a product still updates everything: the item count on the floating cart and menu cart goes up straight away. The shopper just opens the cart themselves when they're ready.
Which should you choose?
- Keep it on if most shoppers buy one or two things per order. Opening the cart puts the checkout button right in front of them.
- Turn it off if shoppers usually add several products in one visit, for example groceries, parts or refills. The cart opening after every add can get in the way.
WooCommerce settings that affect it
Two WooCommerce settings change what happens after an add to cart. Both are at WooCommerce → Settings → Products, under Add to cart behaviour.
| WooCommerce setting | Recommended | Why |
|---|---|---|
| Redirect to the cart page after successful addition | Off | When it's on, WooCommerce sends shoppers to the cart page after every add. They leave the page before the side cart can open. |
| Enable AJAX add to cart buttons on archives | Either | When it's on, the shop page buttons add the product without reloading. When it's off, the page reloads first. The side cart opens either way. |
Auto-open isn't working?
Check Redirect to the cart page after successful addition first. It's the most common reason the side cart doesn't open. If that's off and the cart still doesn't open, see Troubleshooting.
Using WooCommerce's Mini-Cart block too?
Block themes often have WooCommerce's own Mini-Cart block in the header, and WooCommerce sometimes adds it for you. It has its own slide-out drawer, and a setting called Open drawer when adding. If both that and ShapedCart's auto-open are on, shoppers could see two carts open at once.
The simplest fix is to replace the Mini-Cart block with ShapedCart's menu cart, using the [shaped_cart_menu] shortcode. Menu Cart → Block themes shows how. If you'd rather keep the Mini-Cart block, select it in the Site Editor and turn Open drawer when adding off. Compatibility covers other theme carts.
Custom add-to-cart buttons
If a developer has built a custom add-to-cart button or quick view that doesn't use WooCommerce's scripts, ShapedCart won't know a product was added until the next page load. The fix is small: after adding the product, the code triggers WooCommerce's standard added_to_cart event. Developer Reference has the details.
Related
- Opening & Heading: the Auto-open on add setting
- Troubleshooting: the cart doesn't open
- Compatibility: themes, blocks and quick view plugins