Add Multiple WooCommerce Products to Cart in 4 Easy Steps

add multiple products to cart

Add Multiple WooCommerce Products to Cart in 4 Easy Steps

In many WooCommerce stores, customers need to open product pages one by one, choose quantities or variations, and click the add-to-cart button for each item separately. This works for small stores, but it can slow down the shopping experience when customers want to buy several products at once.

A better solution is to let shoppers select multiple products from one page and add them all to the cart with a single click. This is especially useful for wholesale stores, food ordering websites, spare parts shops, clothing stores, product catalogs, and any WooCommerce store where customers often buy more than one item.

In this step-by-step guide, you’ll learn how to add multiple products to the WooCommerce cart using a custom URL method and a more user-friendly product table method with TABLEiT – Product Table for WooCommerce. By the end, you’ll know how to create a smoother bulk add-to-cart experience and help customers complete their orders faster.

What is bulk add to cart for WooCommerce?

WooCommerce add multiple products to cart is a useful technique that lets your customers mark a checkbox next to the products listed in a table and then add multiple items to their carts with one click. The button for adding multiple products to the cart can be designed in the navigation bars like the header or footer.

To show the WooCommerce products in a table and allow customers to bulk add them to their cart, you can either use a piece of code – which is not recommended if you are not an expert or a WooCommerce bulk add to cart plugin.

Let’s review both methods together.

WooCommerce add multiple products to cart by creating a customized URL

Creating a personalized URL allows you to add multiple products to the cart option in your store. To use this method, first, you need to create a child theme, then copy the below code in funcfions.php:

function webroom_add_multiple_products_to_cart( $url = false ) {
        // Make sure WC is installed, and add-to-cart qauery arg exists, and contains at least one comma.
        if ( ! class_exists( 'WC_Form_Handler' ) || empty( $_REQUEST['add-to-cart'] ) || false === strpos( $_REQUEST['add-to-cart'], ',' ) ) {
                return;
        }

        // Remove WooCommerce's hook, as it's useless (doesn't handle multiple products).
        remove_action( 'wp_loaded', array( 'WC_Form_Handler', 'add_to_cart_action' ), 20 );

        $product_ids = explode( ',', $_REQUEST['add-to-cart'] );
        $count       = count( $product_ids );
        $number      = 0;

        foreach ( $product_ids as $id_and_quantity ) {
                // Check for quantities defined in curie notation (<product_id>:<product_quantity>)

                $id_and_quantity = explode( ':', $id_and_quantity );
                $product_id = $id_and_quantity[0];

                $_REQUEST['quantity'] = ! empty( $id_and_quantity[1] ) ? absint( $id_and_quantity[1] ) : 1;

                if ( ++$number === $count ) {
                        // Ok, final item, let's send it back to WooCommerce's add_to_cart_action method for handling.
                        $_REQUEST['add-to-cart'] = $product_id;

                        return WC_Form_Handler::add_to_cart_action( $url );
                }

                $product_id        = apply_filters( 'WooCommerce_add_to_cart_product_id', absint( $product_id ) );
                $was_added_to_cart = false;
                $adding_to_cart    = wc_get_product( $product_id );

                if ( ! $adding_to_cart ) {
                        continue;
                }

                $add_to_cart_handler = apply_filters( 'WooCommerce_add_to_cart_handler', $adding_to_cart->get_type(), $adding_to_cart );

                // Variable product handling
                if ( 'variable' === $add_to_cart_handler ) {
                        woo_hack_invoke_private_method( 'WC_Form_Handler', 'add_to_cart_handler_variable', $product_id );

                // Grouped Products
                } elseif ( 'grouped' === $add_to_cart_handler ) {
                        woo_hack_invoke_private_method( 'WC_Form_Handler', 'add_to_cart_handler_grouped', $product_id );

                // Custom Handler
                        do_action( 'WooCommerce_add_to_cart_handler_' . $add_to_cart_handler, $url );

                // Simple Products
                } else {
                        woo_hack_invoke_private_method( 'WC_Form_Handler', 'add_to_cart_handler_simple', $product_id );
                }
        }
}

// Fire before the WC_Form_Handler::add_to_cart_action callback.
add_action( 'wp_loaded', 'webroom_add_multiple_products_to_cart', 15 );


/**
* Invoke class private method
*
* @since   0.1.0
*
* @param   string $class_name
* @param   string $methodName
*
* @return  mixed
*/
function woo_hack_invoke_private_method( $class_name, $methodName ) {
        if ( version_compare( phpversion(), '5.3', '<' ) ) {
                throw new Exception( 'PHP version does not support ReflectionClass::setAccessible()', __LINE__ );
        }

$args = func_get_args();
        unset( $args[0], $args[1] );
        $method = $reflection->getMethod( $methodName );
        $method->setAccessible( true );

        //$args = array_merge( array( $class_name ), $args );
        $args = array_merge( array( $reflection ), $args );
        return call_user_func_array( array( $method, 'invoke' ), $args );
}

To see the result, you can use the below-customized URL:

For adding 1 quantity of multiple products, just write their ID one time as shown below:

https://www.example.com/cart/?add-to-cart=12345,43453

For adding more than one from a product, copy the product ID multiple times at the end of the URL as illustrated below:

https://www.example.com/cart/?add-to-cart=12345,12345,12345

It is also possible to add quantity to the end of the URL as follows:

https://www.example.com/cart/?add-to-cart=12345&quantity=3

Although by using a customized URL, you can solve the problem of WooCommerce adding multiple products to the cart, it is not the customer-friendly solution that attracts your customers to buy from your store. For example, suppose that your customers want to add multiple variations to the cart at once. Can this method really encourage them to choose your site among your competitors? 

To help you convince customers to buy products from your shop, your ultimate solution is using the WooCommerce bulk add to cart plugin. Continue reading to learn how the WooCommerce product table plugin simplifies the process of adding multiple products to cart for your customers.

The best WooCommerce bulk add to cart plugin

There are many reasons for introducing the WooCommerce product table plugin as the best bulk add to cart plugin. In addition to displaying all your products in a table view, it allows you to add as many columns as you need to your product table. It is also possible to customize your table by adding filters, pagination, search boxes, etc. However, the most amazing feature of this plugin is facilitating the purchase process for your customers by letting them add multiple items to their cart.

Let’s see how.

Step 1: Install WooCommerce product table plugin 

The first step to using this WooCommerce bulk add to cart plugin is downloading, installing, and activating it on your WordPress website. 

Now, you can start creating a new product table by choosing the Add new table option from the iT Product Table menu. In the new page appears, scroll down and click on the get started button.

TABLEiT - Product Table for WooCommerce plugin by ithemeland
select add new table menu and click get start button in WooCommerce
Click on get start button

Step 2: Add columns to the product table

The next step is adding the appropriate columns to the product table by going to the Columns tab. The user-friendly interface of the WooCommerce product table plugin allows you to easily add new columns and assign content to them by following the below instructions:

  1. Click on the Add a column button to see the elements you can assign to it in the left panel.
  2. Choose one of the elements from the left panel.
  3. Customize the element by using the options in the General and Style tabs.
select columns tab and click add a column button in WooCommerce
add element in column table WooCommerce
Add columns to table

Now let’s suppose that by repeating the above mentioned 3 steps, you have added the below columns to the table:

  • Checkbox: to let customers select the products in the table.
  • Title: To show product title to the customers. 
  • Image: To display the product image to the customers.
  • Content: To show product description in the table.
  • Price: To let customers compare product prices in the table.
  • Qty: To allow customers to increase and decrease the number of products they need directly in the table.
  • Variations: To make WooCommerce add multiple variations to the cart at once possible. 
result products columns table in WooCommerce
Added columns to table

Add to cart button

To show the Add to Cart button to the product table, try to:

  • Choose the Button element from the left panel. 
  • In the General tab, select the Cart icon for the Label.
  • Choose Add to Cart via Ajax from the Link items.
select add to cart via ajax option for button element in style tab
Add to cart button settings

Step 3: Activate multiple products to cart for WooCommerce in the plugin

If you want to enable WooCommerce to add multiple products to cart at once, it is required to activate this option in the Navigation tab of the WooCommerce product table plugin. To do this, follow the below instructions:

  1. Press the Add Element option in one of the navigation bars, including Header, Footer, or Sidebar.
  2. Choose Add selected to Cart element from the left panel.
select add selected to cart element in header table
add “Add seleceted to cart” in header
  1. Customize the element in the General and Style tabs. For example, in the label box, you can write any message to be displayed on the button to your customer. By default, the message is “Add selected items to cart“.
customization style tab add selected to cart element in header table
Customize the element

Step 4: Display the product table on the shopping page 

The final step is displaying the product table on the shopping page of WooCommerce by following the below steps: 

  1. Write a name for your table on the top of the screen.
  2. Click on the Save button.
  3. Click on the copy shortcode button.
select name table and save and shortcode button in table WooCommerce
Set a name , copy shortcode and ssave the table buttons
  1. Go to the WordPress dashboard and open a new page.
  2. Paste the shortcode on the page and publish it.
  3. Go to the WooCommerce settings > products.
  4. Open the dropdown list in front of the Shop page and choose the product table page. 
select shop option in shop page WooCommerce
Set the page as default page shop

Now, if you visit the shop page of your website, the result looks like below:

mark products and select add selected button in table WooCommerce
bulk add to cart in action

So, when your customers select some products from your website, they can add them to their cart just by clicking on the add selected items displayed on the product table header.

Extra features of the WooCommerce product table plugin

The features you can add to your product table by using our plugin are unlimited. We provide almost all the options that you may need to add to the table to make an amazing shopping experience for your customers. Here, you can get familiar with some of them:

Search and filter

Adding a search box and filters to the Navigation bars are essential when you want to grab the attention of potential customers. These items are designed as different elements in the WooCommerce product table plugin. So, as we mentioned earlier, you can go to the Navigation tab and try to add a search box or filter elements from the left panel to the Header, Footer, or Sidebar of your table.

select category and price filter element for header in navigation tab
Add filter elements in header

For example, we have chosen a Category filter and price filter to be displayed on the Header.

Display Minicart

Another amazing feature of this plugin is displaying Minicart to the customers on the shopping page. To make this happen, you can choose a Minicart element from the element panel of the Navigation tab. 

For example, we tried to add the mini cart to the footer of our product table:

customization style tab mini cart element in footer table
Add minicart in footer

Like other elements, it is possible to customize Minicart content and appearance by changing the items in the General and Style tabs, respectively.

The result of adding these features to the product table is creating a customer-friendly product table, as shown in the below picture:

result category and price element in table WooCommerce
Minicart and filters in action

What are the advantages of bulk add to cart for WooCommerce?

The biggest advantage of enabling bulk add to cart for WooCommerce is making a better experience for your customers when they are purchasing products from your shop. This useful feature can help buyers choose multiple products quickly and go through the checkout process easier. Simplifying the purchasing process has a great impact on increasing lead generation and boosting your sales.

TABLEiT - Product Table for WooCommerce plugin by ithemeland

When do you need to add multiple products to cart feature on your online store?

The bulk add to cart for WooCommerce is an amazing feature for making a great buying experience for customers. However, activating this feature is not necessary for all online stores. We recommend you let your customers add multiple items to the cart when:

  • You are selling small and low-priced products.
  • You are offering to pack the multiple items that customers selected in a box.
  • You have an online food ordering service, and your customers need to choose different items from the online menu of your restaurant or coffee shop.
  • You are selling some products which must be ordered together.

Conclusion

Adding multiple products to the WooCommerce cart can make the buying process much faster for customers who want to order several items at the same time. Instead of visiting every product page separately, they can select products, choose quantities or variations, and add everything to the cart in fewer steps.

The custom URL method can be useful for simple use cases, especially if you are comfortable working with code. However, it is not always the best option for regular customers because it does not create a visual shopping experience. Customers still need a clear product list, quantity fields, variation options, and an easy add-selected-to-cart button.

For a more practical solution, TABLEiT – Product Table for WooCommerce helps you display products in a table layout and let customers add selected products to the cart from one place. This makes the store easier to use, improves product browsing, and can reduce friction before checkout—especially for stores with large catalogs or repeat buyers.

FAQ

1. How do I add multiple products to the WooCommerce cart?

You can add multiple products to the WooCommerce cart by using a custom add-to-cart URL, custom code, or a product table layout. The product table method is usually easier for customers because they can select products visually and add them to the cart with one click.

2. What is WooCommerce bulk add to cart?

WooCommerce bulk add to cart means allowing customers to add several products to their cart at the same time instead of adding each product separately. This can make shopping faster and reduce the number of steps before checkout.

3. Can I add multiple WooCommerce products to cart via URL?

Yes. WooCommerce can add products to the cart using URL parameters. However, adding multiple products via URL usually requires custom code or a specific URL structure, so it is better for technical users than regular store visitors.

4. Is a bulk add-to-cart button useful for WooCommerce stores?

Yes. A bulk add-to-cart button is useful when customers often buy multiple products in one order. It works especially well for wholesale stores, restaurant ordering, product catalogs, accessories, spare parts, and repeat-purchase products.

5. Can customers choose quantities before adding multiple products to cart?

Yes. If your product table includes a quantity field, customers can choose the quantity for each product before clicking the add-selected-to-cart button. This makes the process more flexible than a simple product list.

6. Can I add variable products to cart in bulk?

Yes, but the method must support variations. With TABLEiT, you can display variation options in the table so customers can choose the right variation before adding selected products to the cart.

7. What is the easiest way to create WooCommerce bulk add to cart?

The easiest way is to use a product table with checkboxes, quantity fields, variation selectors, and an add-selected-to-cart button. This gives customers a clear interface and avoids the complexity of custom code or URL-based methods.

Related Articles

You might also be interested in these articles

Reader Comments

Join the conversation and share your thoughts

Leave a Reply

Start Your Journey

Sign in / Sign up account to continue