Side cart for WooCommerce

The CheckoutWC side cart replaces the trip to your cart page with a cart that slides in from the right whenever a shopper adds an item. Adding to cart opens the side cart, so shoppers review their cart there, apply a coupon, add a suggested product and head to checkout without leaving the page they’re on.

A short demo of CheckoutWC's slide-out side cart for WooCommerce opening when a product is added

When you’d use this

  • You want shoppers to keep browsing after adding to cart, instead of landing on a separate cart page.
  • You want a place to show cross-sells, order bumps or express payment buttons before checkout.
  • You want a “spend $X more for free shipping” bar, or to add a free gift automatically when the cart reaches a set amount.

Set up the side cart

  1. Go to CheckoutWC » Side Cart.
  2. Turn on Enable Side Cart. The rest of the settings appear once it’s on.
  3. Click Save Changes.
  4. On your store, add a product to your cart and check that the side cart slides open.

Everything else on the screen is optional.

Side cart settings

The settings on CheckoutWC » Side Cart are grouped into sections, covered here in screen order.

Side Cart Icon

Used by the side cart and the floating cart button.

  • Icon: choose one of the built-in cart icons.
  • Custom Icon: upload your own icon to replace the one above. It must be an SVG.
  • Width: the icon width in pixels. Default: 34.
  • Icon Color: default #222222.

Suggested Products

Cross-sells shown at the bottom of the side cart.

  • Enable Suggested Products: show the cart products’ cross-sells.
  • Heading: the heading above them. Leave it blank for the default, “You may also like…”
  • Enable Random Cross Sells Fallback: if none of the products in the cart have cross-sells, show random products instead.
  • Link to Product Page: send shoppers to the product page instead of adding the product straight to the cart. Turn this on if your suggested products are variable products, because a variation has to be chosen before they can be added.

Floating Side Cart Button

  • Enable Floating Cart Button: a cart button fixed to the bottom right of every page except the cart page, where it’s hidden.
  • Right Position and Bottom Position: its distance from the edges of the screen, in pixels. Default: 20 each.
  • Hide Button If Empty Cart: hide the button while the cart is empty.

Floating Side Cart Button settings with Enable Floating Cart Button checked and the right and bottom position fields

Free shipping & rewards bar

See Free shipping and rewards bar below.

Empty cart

  • Empty cart image: shown above the empty cart message. Leave it blank for text only.

Options

  • Disable Cart Auto Open: instead of opening the side cart when a product is added, gently shake the floating cart button.
  • Enable AJAX Add to Cart: add products from shop and product pages without a page reload. WooCommerce reloads the page by default.
  • Enable Express Payment Buttons: show express payment buttons from gateways that support the WooCommerce mini cart.
  • Enable Order Bumps: show order bumps that are set to display below cart items.
  • Allow Variation Changes: add an edit link under cart items so customers can switch the variation without leaving the cart.
  • Enable Sale Prices: show the original price, struck through, next to the sale price.
  • Enable Coupons: let customers apply a coupon in the side cart. On the order received and order pay pages, the coupon field follows this setting too.
  • Hide Coupon Code Field Behind Link: keep the coupon field hidden until the customer clicks “Have a coupon code?”
  • Show Shipping and Totals: show shipping and the order total as well as the subtotal.
  • Enable Continue Shopping Button: add a Continue Shopping button at the bottom of the side cart. Off by default.

The Proceed to checkout button uses your theme’s button style unless you set a button color in the Checkout Editor.

Free shipping and rewards bar

The bar at the top of the side cart shows shoppers how close they are to a reward, such as “spend $20 more for free shipping, $50 more for a free gift.” You can set up to three tiers, each with its own threshold, reward, color and messages.

WooCommerce side cart rewards bar with free shipping unlocked and a free gift as the next goal, showing the amount left to spend

Turn on Enable free shipping & rewards bar, then add your tiers.

CheckoutWC free shipping and rewards bar settings showing three reward tiers for free shipping, a free gift, and a custom milestone message

Tier settings

  • Threshold: the cart subtotal that unlocks the tier. It must be above 0. A tier without one never unlocks and is hidden from the bar.
  • Reward: Free shipping, Free gift or Custom message only.
  • Color: the color of this tier’s part of the bar.
  • Short label: the tier’s name on the bar. Defaults to “Free shipping”, “Free gift” or “Reward”.
  • Gift product: the product to give away, for free gift tiers. Only simple products can be gifts, because a variation can’t be added automatically.
  • Unlocked message: shown once the shopper reaches the threshold. Defaults to “Congrats! You get free standard shipping.” for free shipping, or “Reward unlocked!”
  • Locked message: shown until then. %s is replaced with the amount still to spend. Default for free shipping: “You’re %s away from free shipping!”

Short labels and the unlocked and locked messages you type can be translated with a translation plugin such as TranslatePress or WPML, like CheckoutWC’s own text. See Translate CheckoutWC.

Below the tiers:

  • Exclude shipping classes: products in these shipping classes don’t count toward the thresholds. Useful for oversized or freight items.
  • Show on the checkout page: also show the bar in the checkout’s cart summary.
  • Progress Bar Background Color: the color of the empty part of the bar.

Free shipping tiers show progress; they don’t make shipping free

A free shipping tier at $75 doesn’t make shipping free at $75. It only shows progress toward it. You still need a WooCommerce Free shipping method with a matching minimum order amount, under WooCommerce » Settings » Shipping. The settings screen warns you when the two don’t match (see Common issues).

The bar counts the cart the way your Free shipping method does. If the method applies its minimum after coupon discounts (its Apply minimum order rule before coupon discount box is turned off), coupon discounts come off before the bar measures progress, so the bar never shows free shipping unlocked when checkout won’t give it.

How free gifts work

When the cart reaches a free gift tier, the gift product is added at no charge. If the cart drops below the threshold again, the gift is removed.

Free gift with purchase added automatically to the WooCommerce side cart, price struck through and marked Free, with two reward tiers unlocked

  • The gift has no remove link, because removing it would only add it back on the next cart update.
  • If the gift product goes out of stock (with backorders off), is unpublished or can no longer be bought, it’s taken out of the cart. A gift on backorder stays.

For shipping setups that need finer control over what counts toward the bar, developers can adjust the qualifying amount with the cfw_side_cart_qualifying_subtotal filter. For a walkthrough with video, see Turn your free shipping bar into a WooCommerce rewards bar.

The side cart opens on its own when a product is added to the cart, and from the floating cart button. It also opens from links, buttons and cart icons you choose.

Add the cfw-side-cart-open-trigger class to any link, button or element, and clicking it opens the side cart. For a menu item, go to Appearance » Menus, open the item and enter the class under CSS Classes.

Adding the cfw-side-cart-open-trigger CSS class to a WordPress menu item to open the WooCommerce side cart

If CSS Classes isn’t shown, click Screen Options at the top right and turn it on.

Enabling the CSS Classes option under Screen Options in the WordPress menu editor

Use your theme’s cart icon

Most themes’ cart icons open the theme’s own cart drawer. To make the icon open the side cart instead, you need both steps below. With only the first, clicking the icon opens both carts at once.

Step 1: make the icon open the side cart. Return the icon’s CSS selector from the cfw_additional_side_cart_trigger_selectors filter. To find the selector, right-click your theme’s cart icon, choose Inspect, and note the class or ID on the icon or its link.

Step 2: hide the theme’s own cart drawer. CheckoutWC can’t stop your theme’s drawer from opening, so hide it with CSS. If your theme has a setting to link its cart icon to the cart page instead of opening a drawer, use that instead of the CSS; it’s the cleaner fix.

For a block theme using WooCommerce’s Mini-Cart block, such as Twenty Twenty-Five, this snippet does both steps:

add_filter( 'cfw_additional_side_cart_trigger_selectors', function () {
    return '.wc-block-mini-cart__button';
} );

add_action( 'wp_head', function () {
    echo '<style>.wc-block-mini-cart__drawer, .wc-block-components-drawer__screen-overlay { display: none !important; }</style>';
} );

For other themes, replace .wc-block-mini-cart__button with your cart icon’s selector and the two drawer selectors with your theme’s drawer. To match several elements, separate the selectors with commas.

You can add the snippet in CheckoutWC’s PHP Snippets box (CheckoutWC » Advanced, Scripts tab), which runs on every page of your store while CheckoutWC is switched on, or in a code snippets plugin or your child theme’s functions.php.

Hiding a drawer with CSS doesn’t stop it opening, so a theme that locks page scrolling while its drawer is open will still do that. If scrolling or keyboard focus behaves oddly after the change, that’s the cause; your theme’s own cart setting avoids it.

Add a cart icon with a shortcode

The [checkoutwc_cart] shortcode shows a cart icon with a quantity badge that opens the side cart. Options:

  • color: the icon color, for example #222222
  • width: the icon width, for example 30px
  • text_color: the quantity badge color, for example #333333
[checkoutwc_cart color="#222222" width="30px" text_color="#222222"]

Each shortcode keeps its own settings, so you can use a dark icon in your header and a light one in your footer on the same page.

Shortcodes don’t run in WordPress menu items on their own. The Shortcode in Menus plugin adds support.

Add #cfw-cart to the end of any URL on your store to open the side cart when the page loads, for example https://yoursite.com/shop/#cfw-cart.

From your own JavaScript, trigger the cfw_open_side_cart event on the page body:

jQuery( document.body ).trigger( 'cfw_open_side_cart' );

Common issues

Clicking the theme’s cart icon opens a different cart, or two carts

The icon still opens your theme’s cart drawer. Follow both steps in Use your theme’s cart icon.

The cart icon filter seems to do nothing

The filter must return a CSS selector as a string. If it returns nothing, an empty string or null, no click handler is added, and there’s no error. Check what your snippet returns, and that the selector matches the icon you inspected.

The floating cart button is missing on pages other than the cart

CheckoutWC hides the floating cart button on any page whose <body> has the woocommerce-cart class (the real cart page has it). Some plugins, such as JetWooBuilder, add that class to other pages, such as your home, shop and product pages, so the button disappears there with no error. To check, view the page source and look for woocommerce-cart in the body’s class list. To fix it, remove the class from pages that aren’t the cart. Add this in CheckoutWC’s PHP Snippets box (CheckoutWC » Advanced, Scripts tab), a code snippets plugin or your child theme’s functions.php:

add_filter( 'body_class', function( $classes ) {
    if ( ! is_cart() ) {
        $classes = array_diff( $classes, array( 'woocommerce-cart' ) );
    }
    if ( ! is_checkout() ) {
        $classes = array_diff( $classes, array( 'woocommerce-checkout' ) );
    }
    return $classes;
}, 20 );

The button then shows on your home, shop and product pages and stays hidden on the cart page. If you’d rather use CSS only, add the following, replacing 123 with your cart page’s ID:

body.woocommerce-cart:not(.page-id-123) #cfw-side-cart-floating-button { display: block !important; }

Ask the plugin’s developer why it adds the class, since the cause is in that plugin.

A warning says the free shipping tier won’t match your shipping method

A warning that starts “Your Free Shipping method starts at” and says customers “will see “unlocked” here and still be charged” means the tier’s threshold is below your Free shipping method’s minimum order amount. Raise the tier’s threshold to at least the amount the warning names.

“Your Free Shipping method requires a coupon, so reaching this spend tier won’t make shipping free on its own.” means the method needs a coupon. Change the method’s requirement under WooCommerce » Settings » Shipping if spend alone should qualify.

The side cart doesn’t open after adding to cart

Check that Disable Cart Step under CheckoutWC » Pages is off; it skips the cart and can’t be used with the side cart. If the side cart opens but is blank, your theme’s own AJAX add to cart may be conflicting: turn on Enable AJAX Add to Cart here and turn off your theme’s version. See Side cart conflicts for theme-specific steps.

Keep learning