If you own or manage a WooCommerce store on a WordPress site, you’ll know how essential the Add to Cart button is. The final step before a purchase, it’s one of the most important CTA buttons in any ecommerce store, so optimizing it is important. However, the cart button has limited customization options in WooCommerce by default, as you may have discovered.

Common ways of customizing the Add to Cart button include using it in different locations, customizing the behavior of the button when customers interact with it, and changing its messaging or look.

WooCommerce add to cart button example

In this article, we’ll talk about the benefits of customizing the Add to Cart button and the most common ways of doing so. We’ll also explain why using a plugin is the best way to customize it, and introduce you to FooGallery PRO Commerce

Why Create a Custom Add to Cart Button for Your WooCommerce Store? 

A prominent and eye-catching Add to Cart button can encourage more customers to make a purchase, resulting in increased sales and revenue on an ecommerce site. There are three main kinds of Add to Cart button customization:

1. Displaying the Add to Cart Button on Other Parts of a WordPress Website

In WooCommerce, the Add to Cart button is usually displayed below the product on a single product page. Its placement may vary depending on the WooCommerce theme you are using, but it is usually located somewhere near the bottom of the page, below the product, product description, price, and other details.

Many WooCommerce users customize the Add to Cart button so that it can be displayed in other parts of their website such as in the WooCommerce shop archive, on the website’s home page, in galleries, notification bars, or pop-ups on various site pages. This widens the scope for product sales.

2. Customizing the Look of the Add to Cart Button

Customizing the messaging on the Add to Cart button can help to boost an online store’s brand identity, making it more iconic and recognizable to customers and helping to differentiate it from competitor sites. 

example of a customized add to cart button

For a quirky or playful brand, “Add to Cart” may feel a bit bland as messaging and the text could be changed to something like “Bag it now” or “Snap it up”. For the same reasons the size, background color, and design of the Add to Cart button is often changed to suit a store’s brand personality.

3. Customizing the Functionality of the Add to Cart Button

This can create a smoother user experience and help boost product sales. Here are some examples of different functionalities you can add to Add to Cart button:

  • Custom product options: This lets you embed product options like color, size, or style into the purchase process, enabling customers to specify variations before adding items to their cart.
  • Product bundles: With this functionality, you can bundle multiple products together and offer them as a package deal, which customers can buy with a single click.
  • Upsells and cross-sells: Complementing a product with others that relate to it, through upsells or cross-sells linked to the Add to Cart button, can encourage customers to add extra items to their cart.
  • Quantity selector: Adding a quantity selector to the Add to Cart button allows customers to specify the number of items they want to purchase.
  • A/B Testing the Button: By customizing the messaging on the Add to Cart button, you can conduct A/B testing to determine which message leads to higher conversions and sales.

Common Ways of Customizing the Add to Cart Button

Let’s look at the different ways you might want to customize your WooCommerce Add to Cart button, in more detail:

Display Add to Cart Buttons Anywhere on your Website

Different locations may include:

  • Your homepage or landing page: A great way to drive sales is to showcase product galleries upfront on your website before visitors even navigate to your store pages. This would give them a great idea of your catalog and may help to prevent visitor drop-off.
    Such galleries should be shoppable (i.e., integrated with WooCommerce), with Add to Cart buttons on the product images, enabling customers to go straight from the gallery to checkout (to enable this, you’ll need a suitable plugin, which we’ll come to later). 
  • Your shop page: You could display the Add to Cart button under top-selling products on your shop page, allowing customers to add them to their cart without having to browse individual product pages. 
example of an add to cart button on the shop page
  • In the sidebar: Displaying the Add to Cart button in the sidebar of your website would enable customers to add products to their cart from any page on the website.
  • Archive pages: Displaying the Add to Cart button next to line items on your store’s archive pages would allow customers to add products to their cart directly from these. 
  • In a popup or notification bar: For special occasions, you might want to display a specific product with an Add to Cart button in a popup or notification bar, prompting visitors to add it to their cart wherever they are on your site. This can be achieved through custom development or by using a plugin that provides this functionality.

Customize the WooCommerce Add to Cart Button Text

Customizing the Add to Cart button’s text may create a more intuitive and user-friendly shopping experience for customers. For example, changing the text of the button to “Buy Now” or “Add to Bag” may resonate better with your specific customer base, generating more customer clicks. You could also utilize FOMO-style messaging to drive conversions, like “Buy before gone”.

example button with customized text

Change the Design of the Add to Cart Button

You might want to customize the look of the Add to Cart button by changing its color, size, or style, to better match your website’s look and feel. It can be possible to add custom icons to the Add to Cart button, like a cart icon, to make it more visually appealing and unique. It may also be possible to add hover effects to the Add to Cart button, to provide a more interactive and engaging shopping experience.

Add Variation Dropdowns and Quantity Fields to the Add to Cart Button

  • Variation dropdowns: If products have variations such as different colors or sizes, you may want to add dropdowns to the Add to Cart button, to allow customers to select the variations they want before adding products to their cart.
  • Quantity fields: You may want to add a quantity field to the Add to Cart button to allow customers to select the number of items they want to buy.

Modify the Add to Cart Button for a Smoother User Experience

  • AJAX Add to Cart: This functionality allows customers to add products to their cart without having to navigate to the cart page each time. Every time the Add to Cart button is clicked, a product is added to the cart in real-time, without the cart page loading. 
  • Popup cart: At the same time, you could link functionality to the Add to Cart button, to display the contents of the customer’s cart in a popup window in the sidebar. This would enable them to view and modify their shopping cart contents as they shop.
  • One-click checkout: You might want to implement one-click checkout functionality, to enable customers to skip the cart page entirely and go straight to the checkout page after clicking the Add to Cart button. 

How to Create a Custom Add to Cart Button in WooCommerce

Let’s explore three methods for customizing Add to Cart buttons in WooCommerce: using shortcodes, coding, and leveraging dedicated plugins. We will begin by examining the default functionality provided by WooCommerce, which involves utilizing shortcodes. However, we ultimately recommend the use of dedicated plugins due to their ease of use and comprehensive functionality. Plugins offer a convenient solution that eliminates the need for manual coding and simplifies the customization process. Let’s delve into each method and discover why utilizing plugins is the optimal choice for most users!

1. Using WooCommerce Shortcodes to Display the Add to Cart Button on Other Pages 

WooCommerce enables shortcodes, which are small code snippets that can be inserted into any site page or post to display dynamic content, including the Add to Cart button. This is an effective way of displaying the Add to Cart button on product images elsewhere on your site, but you won’t get any customization options for the button (however, you could customize the button first, using either code or a plugin, as we’ll see below).

Here are the steps to follow to add the Add to Cart button to other pages using shortcodes:

  • Go to the page where you want to display the Add to Cart button on a product image.
  • Enter the shortcode [add_to_cart id=”PRODUCT_ID”] in the page content area.
  • Click on your WooCommerce Products in your WordPress menu, find the product by its title, and hover over it to see its product ID.
  • Go back to the page and replace PRODUCT_ID in the shortcode with the ID of the product.
  • Preview the page to check that the Add to Cart button is displayed on the product image.
  • Save and publish the page.

2. Customizing the Add to Cart Button Using Code

Using code requires a good understanding of HTML, CSS, and PHP but it allows you to create a highly customized and unique Add to Cart button in WooCommerce. We wouldn’t recommend this method unless you are an experienced WordPress developer, work with one or take the trouble to go through several tutorials to learn custom code.

Still, here are the steps for customizing the Add to Cart button in WooCommerce, using code:

  • Create a child theme: This is recommended to avoid losing your button customizations when you update your theme in the future. You can create a child theme by following these instructions on the WordPress Codex.
  • Locate the Add to Cart button code: This can be found in the WooCommerce templates. The most common template for the Add to Cart button has the following code: single-product/add-to-cart/simple.php.
  • Customize the button code: You can customize the button code by modifying the HTML and CSS in the simple.php template file. For example, you can change the button text, color, size and position. You can also add new elements to the button such as icons, images or tooltips. Additionally, you can modify the button behavior by adding JavaScript or PHP code.
  • Save your changes: After making your customizations, save the simple.php file and upload it to your child theme folder.
  • Test your changes: After making changes to the Add to Cart button, it’s important to test the button to ensure that it looks and works as expected.

3. Using Plugins to Customize the Add to Cart Button

This is the method we would suggest for most WooCommerce store owners; WordPress plugins are typically easy to use.

There are lots of WordPress plugins available for customizing the Add to Cart button and choosing the right one depends entirely on the functionality you need. You will need a WordPress plugin that is compatible with WooCommerce

The one we would recommend is FooGallery PRO Commerce, which is a gallery plugin with a focus on ecommerce. It lets you display dynamic product galleries on any page of your site. Using this plugin, you can easily put an Add to Cart button on the product images in your galleries, customize the messaging or behavior of the Add to Cart button and add extra buttons and elements to prompt customers to buy. Here’s how.

The Best WordPress Gallery Plugin

FooGallery is an easy-to-use WordPress gallery plugin, with stunning gallery layouts and a focus on speed and SEO.

How to Customize the Add to Cart Button With FooGallery PRO Commerce

Earlier we mentioned the value of displaying products in shoppable galleries elsewhere on your site, rather than just in WooCommerce. This is where FooGallery comes in. FooGallery is an easy-to-use WordPress gallery plugin with a variety of stunning gallery layouts and a focus on speed and SEO.

example of FooGallery PRO Commerce product gallery

The PRO Commerce plan integrates fully with WooCommerce, letting you pull products from WooCommerce and add them to engaging image galleries anywhere on your site. It also offers extensive gallery customization, image protection and plenty more features. 

Let’s look at how to set up FooGallery PRO Commerce, create a new image gallery, add products from WooCommerce, then add and customize the Add to Cart button.

Purchasing, Installing, and Activating FooGallery PRO Commerce

  • First, select the FooGallery PRO Commerce plan here (only PRO Commerce integrates with WooCommerce).
  • Process the payment, then check your email for your download link and FooPlugins license key.
  • Download the .zip file containing FooGallery PRO Commerce and save it to your desktop.
  • On your WordPress dashboard, go to Plugins –> Add New. Click on Upload Plugin and the below screen will appear:
Install FooGallery
  • Drag and drop the .zip file into the field.

Creating a New Product Gallery

  • Once you’ve activated the plugin, go to FooGallery in the WordPress dashboard and select Add New. Next, you’ll be prompted to either upload or add images from your media library or from another source.
  • On the PRO Commerce plan, you can pull in images from sources including media tags, server folders, or WooCommerce.
  • After populating the gallery, you can choose the layout you want and customize it at leisure – there are tons of customizations available to you.

Loading Product Images to a Gallery from WooCommerce

  • To load product images to your new gallery, click on Add Media from Another Source. You’ll see this option in the Gallery Items panel of your gallery:
Add gallery from another source
  • You’ll be directed to a new panel, where you can select the source from which you want to load images. Click on WooCommerce Products at the bottom of the list:
use WooCommerce products to create a dynamic gallery
  • Now you can select products for your gallery individually or select them by category. You can set the number of products to show in the gallery, and you can include a list of product IDs for any items you want to exclude.
  • You’ll need to decide what to use as the title and description source for your images. For example, if you just want to display the product title and cost, then you would select Title for Caption Title Source and Price for Caption Description Source:
customize WooCommerce product images for your gallery
  • Once you’ve set up the gallery images, click on OK in the bottom right corner and your gallery will be dynamically populated.

Adding and Customizing the Add to Cart Button

  • Once you’ve loaded your images from WooCommerce, go to the Edit Gallery page and click on the Ecommerce tab. In the settings panel, you will see a number of options for your product gallery, including your button settings: 
add to cart button settings
  • In your button settings, the Add to Cart button will be set to Show by default.
  • You can set the button to behave in different ways, by selecting an option from the “Add to Cart” Button Behaviour dropdown:
    • Add to cart (AJAX)
    • Add to cart and refresh page
    • Add to cart and redirect to cart
    • Add to cart and redirect to checkout
  • If you decide to redirect clicks to checkout you might want to change the text on your Add to Cart button, to turn it into a Buy Now button. In the screenshot above, you can see the “Add to Cart” button text, where you can make this change.
  • Also in button settings, you can choose to Hide or Show and set the behavior of a View Product button, to redirect customers to the single product page in WooCommerce, to a bigger view of the image in the gallery lightbox, or elsewhere. You can set the priority of this button so that it appears first or last in relation to your Add to Cart button. You can also change the text on this button if you want to.
  • You can also Hide or Show and set the behavior of a Select Options button,
    for variable products that have different sizes, colors, or other variations.
  • For all three buttons (if you use all three), you can choose to Enable or Disable them in your gallery’s lightbox:
lightbox button settings

Here’s an example of a product gallery, using buttons and ribbons:

Create Custom Add to Cart Buttons With FooGallery PRO Commerce

Being able to put the WooCommerce Add to Cart button anywhere on your site clearly benefits conversion rates, as does the ability to change how customers read it or interact with it. In this article, we’ve covered the different ways in which you can customize the Add to Cart button and settled on a popular plugin as the best option.

As a photographer I rely heavily on good quality responsive galleries and those that are easy to manage and display with impressive options. FooGallery do all this in spades and on top of that their technical support is best there is.


With FooGallery PRO Commerce, creating a WooCommerce custom Add to Cart button is easy, but you get much more than that, including:

  • The ability to add SEO-friendly product galleries to any page
  • Selection of gallery layouts
  • Seamless integration with WooCommerce
  • Customizable Add to Cart, View Product, and Select Options buttons
  • Customizable sales ribbons
  • Image filtering for easy searching
  • Customizable gallery lightbox
  • Image protection
  • Hover effects and presets
  • Add videos

In short, FooGallery PRO Commerce is your all-in-one visual toolkit for driving product sales on your ecommerce store. Ready to open it up and try out your shiny new tools? Click here to get FooGallery PRO Commerce.

The Best WordPress Gallery Plugin

FooGallery is an easy-to-use WordPress gallery plugin, with stunning gallery layouts and a focus on speed and SEO.