Introduction

How To Change Cart Icon in WooCommerce

WooCommerce is one of the most flexible eCommerce solutions for WordPress, allowing store owners to customize nearly every detail of their online shop. One small but impactful customization is changing the cart icon.

Whether you want a more modern design, better brand alignment, or improved user experience, updating your cart icon can instantly elevate your store’s appearance.

In this guide, you’ll learn multiple ways to change the cart icon in WooCommerce, with and without coding.


Why Change the Cart Icon in WooCommerce?

Customizing your cart icon isn’t just about looks. It can:

  • Strengthen brand identity with a unique, branded icon

  • Improve user experience by using a clearer cart symbol

  • Enhance visual appeal and modernize your header

  • Increase conversions with a more noticeable cart design

Even small UI changes can positively affect customer engagement.


Method 1: Change Cart Icon Using Font Awesome (Easy Method)

This is one of the simplest ways if your theme supports icon fonts.

Step 1: Add Font Awesome (If Not Already Included)

You can install a plugin like:

  • “Font Awesome”

  • Or use a theme that already supports it

Step 2: Replace the Cart Icon Code

Locate your cart icon inside:

Appearance → Theme File Editor → header.php

Replace the existing icon code with something like:

<a class=“cart-icon” href=<?php echo wc_get_cart_url(); ?>>
<i class=“fas fa-shopping-bag”></i>
<span class=“cart-count”>
<?php echo WC()->cart->get_cart_contents_count(); ?>
</span>
</a>

You can replace fa-shopping-bag with:

  • fa-shopping-cart

  • fa-basket-shopping

  • Any icon from Font Awesome


Method 2: Use a Custom Image as Cart Icon

If you prefer a fully branded design:

Step 1: Upload Your Icon

Go to:

Media → Add New

Upload your custom PNG or SVG cart icon.

Step 2: Insert the Image in Header

Update your cart code to:

<a class=“cart-icon” href=<?php echo wc_get_cart_url(); ?>>
<img src=“YOUR-IMAGE-URL-HERE” alt=“Cart”>
<span class=“cart-count”>
<?php echo WC()->cart->get_cart_contents_count(); ?>
</span>
</a>

Replace YOUR-IMAGE-URL-HERE with the actual image URL from Media Library.


Method 3: Change Cart Icon Using CSS Only

If your theme already includes a cart icon but you want to replace it visually, you can override it using CSS.

Example:

.site-header .cart-icon:before {
content: “\f07a”;
font-family: “Font Awesome 6 Free”;
font-weight: 900;
}

This method is safer because it doesn’t require editing theme files.


Recommended: Always Use a Child Theme

Before editing theme files:

  • Create a child theme

  • Or use a code snippets plugin

  • Avoid editing the parent theme directly

Otherwise, your changes will disappear after theme updates.


Styling Your New Cart Icon

You can improve the look with CSS:

.cart-icon {
position: relative;
display: inline-flex;
align-items: center;
}

.cart-icon img,
.cart-icon i {
font-size: 24px;
width: 28px;
}

.cart-count {
position: absolute;
top: -8px;
right: -10px;
background: #ff4d4d;
color: #fff;
font-size: 12px;
padding: 2px 6px;
border-radius: 50%;
}

Adjust colors and sizes to match your brand.


Common Issues & Fixes

Cart Icon Not Updating

  • Clear cache (browser + caching plugin)

  • Regenerate CSS if using page builders

Cart Count Not Showing

  • Make sure WooCommerce is active

  • Ensure WC()->cart->get_cart_contents_count() is inside PHP tags

Changes Disappear After Update

  • You edited the parent theme

  • Switch to a child theme immediately


Final Thoughts

Changing the cart icon in WooCommerce is a simple customization that can significantly improve your store’s design and branding. Whether you use Font Awesome, a custom image, or CSS overrides, the process is straightforward once you know where to make the changes.

Small design improvements like this can enhance user experience and make your store look more professional and trustworthy.

What should you do next?

Thanks for reading till the end. Here are 4 ways we can help you grow:

Want to learn more?

Explore our full collection of How-To guides to master every feature and functionality.

Check out How-To Guides →

Looking to grow your store?

Browse our WooCommerce plugins to discover tools that can improve performance and boost your sales.

Browse WooCommerce Plugins →

Curious about related topics?

Visit our blog for more tutorials, expert insights, and the latest trends in e-commerce.

Visit Our Blog →

Still confused about this topic?

Submit your question or contact our support team directly. We are here to help!

Contact Support Team →

Latest Articles

Shopping Cart