Adding A Quick Add To Cart Button To The Woocommerce Shop

Adding A Quick Add To Cart Button To The Woocommerce Shop

This post has not been updated for a few years and I can getting a few comments that it no longer works using Divi.  I don’t use Divi any more so if anyone has any updated code that works please post below and I can update the post & credit.

So, this started when a client of ours wanted a way to add products quickly to their cart from the main “shop” page within WooCommerce and the Category Archives as well. We were using Divi (this can be used for any theme) and we now have the following solution. Here you can see the change:

Image temporarily unavailable

So, first off let me just say that we are using Font Awesome throughout the site anyway, so we thought we would integrate it into this area as weel with the cart icon.

The first thing to do is get to the WordPress dashboard and get into your theme files. Go to Appearance >> Editor – This tutorial is presuming you are correctly using a child theme.

Image temporarily unavailable

On the right hand side you will see the relevant files that we will need to access, those being the functions.php and the style.css file. First off, let’s paste the correct code into the functions file. Click on the functions.php link on the right hand side.

Image temporarily unavailable
//FONT AWESOME ENQUEUE
 
function enqueue_our_required_stylesheets(){
wp_enqueue_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');
}
add_action('wp_enqueue_scripts','enqueue_our_required_stylesheets');
 
 
// ADDING CART ICON TO PRODUCT ARCHIVES
 
add_action('woocommerce_shop_loop_item_title','replace_add_to_cart');
function replace_add_to_cart() {
global $product;
$id = $product->id;
$sku = $product->get_sku();
echo '';
}

Above you will see the code for adding Font Awesome to our site, as well as adding the relevant code for the Add To Cart button. All the code is doing, is pulling through the relevant product ID and Title for the product and adding it to the cart for us. So copy the code above, and paste it at the bottom of your functions.php file.

Next up, we need to then need to navigate to the style.css file and copy the code below, and paste it into your stylesheet and save.

.woocommerce ul.products li.product .button::before {
content: "\f217";
font-size: 30px;
font-family: FontAwesome;
color: #333 !important;
}
 
.woocommerce ul.products li.product .button {
margin-top: 0;
padding: 0 !important;
z-index: 9999;
float: right;
}
 
.woocommerce a.button.ajax_add_to_cart {
font-size: 17px;
background: none !important;
border: none !important;
text-align: center;
}
 
.woocommerce a.button.ajax_add_to_cart:hover {
font-size: 17px;
background: none !important;
border: none !important;
}
 
.woocommerce a.button.ajax_add_to_cart:hover::after {
display: none !important;
}

Save the style.css file, and reload your shop page, and it will look like this

Image temporarily unavailable

That’s it! All done. Of course, you can play with the colours of the icons etc. But that is a nice simple way to add the function to your site.

I am working on a way to display a popup on adding it to the cart to let you know its been added and will add that to this post once I have done that.

Any questions drop me a comment below ?

← All posts Next: Why a great website is so import…
Let's create something great

Got a project brewing? Let's talk it over a coffee.

Whether it's a fresh build, a redesign or an ongoing helping hand — we'd love to hear what you're working on. No jargon, no pressure, just honest advice from a Newquay studio.

Start a project 07427 414851
5 ★★★★★ · 10+ reviews on Google
★★★★★

Hi Shaun - just to say this is such a lovely design and a huge improvement on where we were. Thanks so much for the video and handling all of that too - they are brilliant.

Sarah @ TreloyMar 2026
★★★★★

Working with Shaun has been fantastic. A proper pro, always on hand to help sort things out and provide advice and guidance when needed. And not forgetting his design skills, creativity and knowledge of building websites making them work and run as smoothly as possible - a 1st class service.

Matt LidburyMay 2026
★★★★★

Shaun at Innuvo has produced an outstanding site for me. He took time to understand what I needed and explained how things would work, and has blown me — and many of my customers — away with the resulting stunning website. He's been very patient with edits and was on-hand when I went live. The payment system worked without a glitch, and I'm sure it was thanks to the site being so clean and engaging that I sold out of my product within 48 hours. Thank you so much.

Frances Houghton MBE
★★★★★

We used the services of Innuvo to build our new website for our architectural company. As we're design based, we had really strong ideas of how this should look and feel. Shaun interpreted our requirements perfectly and spent a lot of time ensuring we got exactly what we wanted. His professionalism and patience throughout the whole process were outstanding. We definitely made the right choice and would not hesitate in recommending their services. Thanks again Shaun.

Lee Crease
★★★★★

Shaun has produced an absolutely first class website for my new company. I was after a very specific look and feel and Shaun captured that vision perfectly and turned it into reality. His patience and understanding throughout the process were exceptional — even though I kept wanting to make changes, nothing was too much trouble. His knowledge of web design is exemplary and his pricing very reasonable for the quality. I'd definitely recommend Innuvo and Shaun to anybody.

Andrew White
★★★★★

As a superyacht, medical and premier automotive design consultancy, the pressure was on for Shaun. Challenge accepted — high-end results achieved in line with my minimal aesthetic. Great work Innuvo, highly recommended.

Morpheus7
★★★★★

I've been absolutely astounded by the amazing support given by Shaun at Innuvo. He really knows his stuff and never fails to solve any issues I come across very quickly. It's not often I feel the need to rave about customer service, but this guy has surpassed all expectations. I have absolute confidence in his abilities — he's like a WordPress wizard!

Sally Harwood
★★★★★

Working with Shaun of Innuvo to develop my business website was a really positive experience. I explained my vision and site concept and he developed some possible looks. I have no hesitation in recommending Innuvo to prospective customers.

Miles K
★★★★★

Top class web design service. Shaun really knows his stuff when it comes to building websites. Nothing is too difficult, and the more technical bits like CSS or PHP are second nature to him. Experienced and very knowledgeable in all areas, and the after-support once the site was built has been fantastic. Worth his weight in gold — thanks again!

Chris Sweet
★★★★★

We hired Innuvo to build our new website and are extremely happy with the results. Professional, responsive and a pleasure to work with from start to finish.

Jam Press
★★★★★

Shaun at Innuvo formed my website for my start-up company. Following an initial conversation he instantly understood the ethos of the company and translated that into the layout and imagery of the website — it needed very little amending from the first draft. Shaun delivered on creativity and the right site to attract my target market. His ability to respond and deliver very quickly impressed me, and he was always helpful and willing. I thoroughly enjoyed working with him.

Natasha Stevens
★★★★★

Really pleased with the work and cannot recommend Shaun enough.

Sean Johnston