The drawer does not open after add to cart
Why the cart drawer may stay closed when a customer adds a product, and how to check each cause.
Work through these checks in order. Most cases come down to a setting, or to a theme that adds products to the cart in a way CartPops cannot see.
1. Check the trigger setting
- Go to WooCommerce > CartPops > Advanced.
- On the General tab, check Open drawer on.
- Add to cart opens the drawer after a customer adds a product.
- Launcher click only keeps the drawer closed until the customer clicks a launcher. This is the setting to change if the drawer never opens on add to cart.
Also check that Enable CartPops is on in the same section. When it is off, CartPops does not render anything on your storefront.
2. Check how the product is added
CartPops opens the drawer when WooCommerce reports a successful add to cart. It listens for two WooCommerce events:
- The classic
added_to_cartevent, which WooCommerce fires after an AJAX add to cart. - The
wc-blocks_added_to_cartevent, which WooCommerce fires after an add to cart from a WooCommerce block.
If the page reloads when the customer clicks Add to cart, no event fires and the drawer stays closed. This usually has one of two causes:
- Shop and category pages. In WooCommerce, go to WooCommerce > Settings > Products and turn on Enable AJAX add to cart buttons on archives.
- Single product pages. CartPops adds from the standard WooCommerce product form without reloading when Add to cart on product pages without reloading is on (WooCommerce > CartPops > Advanced > General). It is on by default. The page still reloads, and the drawer stays closed, for products with a file upload field, external and grouped products, when WooCommerce redirects to the cart after adding, and when the add cannot reach your store in the background. If your theme or another plugin handles the product form itself, it decides what happens.
CartPops attaches its listener for the classic event when its script loads, and only if jQuery is already on the page. If a speed plugin delays or defers jQuery, CartPops never hears classic AJAX adds. Exclude jQuery and WooCommerce’s add-to-cart script from any delay-JavaScript feature.
Some themes and page builders add to cart with their own JavaScript and never fire the WooCommerce events. Developers can open the drawer from their own code. See the JavaScript reference.
3. Check for an opt-out on the button
A button with the attribute data-cpops-cart-open="false" adds to the cart without opening the drawer. Check your theme templates and page builder for this attribute.
4. Check that the drawer is on the page
CartPops adds the Cart Drawer to the footer of your pages automatically. It keeps the first Cart Drawer block on a page and removes duplicates. The drawer will be missing if:
- Enable CartPops is off.
- A code snippet uses the
cartpops_render_drawerfilter to turn off the automatic drawer. - Your theme does not call
wp_footer(). Most themes do, so this is rare.
See cartpops_render_drawer in the PHP filters reference.
The floating launcher is separate from the drawer. Hide launcher on pages on the Launcher screen hides only the floating launcher. It does not stop the drawer from opening after an add to cart.
5. Look for caching and script problems
If the drawer opens in a private browser window but not for you, or opens only after a hard refresh, a cache is the likely cause. If a JavaScript error from another plugin appears in your browser console, it can also stop the drawer script from running. Turn off script combining and delaying (including for jQuery), then clear your caches. See Caching.
Still stuck?
Switch to a default theme such as Twenty Twenty-Five and turn off other plugins, then test again. If the drawer opens, add things back one at a time until it stops. When you contact support, include the name of the theme or plugin that makes the difference.