Home > WooCommerce > Docs > How to Add Products to Cart in WooCommerce

How to Add Products to Cart in WooCommerce

Last updated: August 01, 2024
Written and researched by experts at AvadaLearn more about our methodology

By Sam Nguyen

CEO Avada Commerce

If your online store sells one product, you may wish to automatically add it to the customer’s cart. This eliminates the need for the user to locate an “Add to Cart” button and manually add the item to their cart. Stores that are marketing a specific product may also wish to automate the cart addition process.

Because clients no longer need to manually add products to their carts, they can continue directly to the checkout page. This can assist your business by increasing sales and decreasing the likelihood of customers abandoning their shopping cart.

In this post, we’ll demonstrate How to Add Products to Cart in WooCommerce automatically to boost your online sales.

Why you might need to automatically add products to the cart?

If clients are not required to add items to their carts, you can save them considerable time when they make a purchase from your WooCommerce store.

In basic terms, you can accelerate your website’s purchasing user processes by skipping the add-to-cart step and moving directly to checkout. Additionally, this can entice customers to investigate your store’s additional products.

By adding things to your customer’s cart automatically, you eliminate friction from the shopping process. Customers will be able to quickly browse and purchase products from your WooCommerce store.

Consider the following instances of firms that could profit from this:

  • Clothing retailers: Automatically adding things to a customer’s cart can assist apparel stores. Clothing stores, in general, sell items such as hats, t-shirts, hoodies, caps, and belts. Customers who visit your business must already purchase clothing, therefore automatically adding them to the shopping cart when they browse a single product page will expedite the purchasing process.
  • Sporting and fitness retailers: Stores that sell only sports and fitness equipment can benefit from this, as visitors to your online site will be looking to purchase only sports equipment. Automatically adding a workout bag or yoga mat to a customer’s basket can help you increase your average order value.
  • Supermarkets: Grocery retailers may find it advantageous to automatically add featured products to their customers’ carts. For instance, if you’re running a promotion on orange juice or milk, you can have the item added to the customer’s cart immediately. It’s an excellent method of increasing product visibility and encouraging buyers to explore new products.
  • Membership sites: Membership sites that only provide one membership type may find it advantageous to automatically add the product to the customer’s basket. Similarly, suppose your store sells a mystery box containing a variety of products or a subscription box for shaving kits, you may immediately add them to the customer’s basket when they arrive on your website.

How to add products to cart in WooCommerce automatically with code

Add this code to the functions.php file of your child theme or using a plugin that supports custom functions, such as the Code snippets plugin. Avoid directly adding custom code to your parent theme’s functions.php file, as this will be overwritten when the theme is updated. Code 1

If you want to add a product to the cart automatically based on the cart total, use the following code: Code 2

How to add products to cart in WooCommerce automatically with plugin

We’ll demonstrate how to use the Booster Plus for WooCommerce plugin to automatically add products to the customer’s cart.

Step 1: Install and Activate the plugin

Let’s begin by downloading and activating the plugin. To access the WordPress Admin Dashboard, navigate to Plugins > Add New and type Booster Plus for WooCommerce into the search field. Install Now and then activate the plugin after it has been installed. Booster Plus for WooCommerce

Step 2: Enable the WooCommerce Product Add to Cart module in the first step

From the admin panel, head to WooCommerce > Settings > Booster to access the various modules. This section contains a list of available modules. We’re going to enable the Add To Cart In WooCommerce module. Add To Cart

Under the Products section, click the Add to Cart module. To enable a module, choose the checkbox next to it. When finished, click the Save Changes option at the bottom of the screen to proceed. Add to Cart

Step 3: Configure the plugin

To configure the module’s settings, navigate to Booster > Products > Add to Cart.

To automatically add products to your customer’s cart when they visit the product page, click the dropdown menu next to Add to Cart on Visit and select All products. Configure the plugin

Additionally, using the same dropdown menu, you can select the Per product option, which will add a meta box to each product’s edit page. This manner, when a customer visits a single product page, just selected products are instantly put to their cart. This is ideal for stores that sell many products and wish to automatically add featured products to the customer’s cart.

When finished adjusting the module’s settings, click the Save Changes option to proceed.

Step 4: Preview the settings

When a customer views a product page, the item is automatically placed in their basket. On the front end, it will appear something like this: Preview the settings

3 plugins to add products to cart in WooCommerce

1. Cart All In One For WooCommerce

Cart All In One For WooCommerce

The WooCommerce Cart All In One plugin is a robust plugin that enables you to innovate the Cart’s functionality on your WooCommerce store. Additionally, the plugin provides users with numerous essential tools for designing all of the features associated with WooCommerce, such as Sidebar Cart, Menu Cart, Sticky Add To Cart button, and Checkout on Sidebar Cart, which will help your WooCommerce Store run more efficiently.

Key Features:

  • Sidebar cart: Customers can add coupons, change the quantity of products, delete items, and check out directly from the sidebar cart.
  • Menu Cart: Add a cart icon to the menus.
  • Ajax Add To Cart: Allows customers to add things to their cart without reloading the page from single product pages or quick view pop-ups.
  • Add To Cart Button for Variable Products: Customers can select variations and add things to their carts directly from archive pages without navigating to individual product sites.
  • Prior to publishing, the designs can be viewed in the setup area.

Price:

The plugin has a free version. You can also upgrade to the PRO version with the price of $30 for a Regular License.

2. Multiple Products to Cart – WooCommerce Product Table

Multiple Products to Cart

Easy-to-use and quickWooCommerceMultiple Products to Cart – WooCommerce Product Table simultaneously adds numerous products to the cart. Excellent for accessories, restaurants, and any other WooCommerce store, and excellent for increasing conversions. A genuinely lightweight and simple-to-use yet strong plugin devoid of superfluous features, hussle, and a low page speed score!

Key Features:

  • Compatible with MULTISITE.
  • Modify your theme’s product table.
  • Both simple and variable product types are supported.
  • Completely responsive to all contemporary devices.
  • Extremely fast for displaying a large number of products on a single page.
  • Truly lightweight, with a negligible effect on page speed.

Price:

The plugin is free of charge.

3. Booster Plus for WooCommerce

Booster Plus for WooCommerce

The Booster Plus for WooCommerce plugin is straightforward to install, configure, and use. We give documentation for each module, a plethora of video tutorials on YouTube, and a great, responsive customer support team if you need assistance. With over 100 choices for customizing and extending any WooCommerce website, Booster Plus has been dubbed the “Swiss Army Knife” of modules. By downloading a single plugin, you can eliminate the slowdown issues associated with 10-15+ plugins. Because all modules are included in the same plugin, conflicts are avoided.

Key Features:

  • Customize products or establish automatic discounts.
  • Customize the checkout process using WooCommerce custom fields.
  • Enables you to personalize your goods’ buttons and price labels.
  • Customize your emails and add more recipients.
  • Create professional WooCommerce PDF invoices and packaging slips.
  • Display products in many currencies with automatic currency conversion and price regulations.

Price:

There are 3 price plans for you to choose from:

  • Basic - 1 site: €49.00/year.
  • Pro - 3 sites: €169.00/year.
  • Elite - 30 sites: €297.00/year.

Final thoughts

Eliminating stages from the standard purchasing process is an excellent strategy for improving the shopping experience and increasing revenue. By automatically adding things to the customer’s cart, you ensure that they do not overlook an item they intended to purchase. This is advantageous for many types of businesses, but particularly those that offer a high volume of low-cost commodities, such as groceries.


Sam Nguyen is the CEO and founder of Avada Commerce, an e-commerce solution provider headquartered in Singapore. He is an expert on the Shopify e-commerce platform for online stores and retail point-of-sale systems. Sam loves talking about e-commerce and he aims to help over a million online businesses grow and thrive.

Stay in the know

Get special offers on the latest news from AVADA.