How To Split Orders in WooCommerce

The code in this download folder enables you to split orders when using WooCommerce. In this case we split orders based on shipping class so the product with the shipping class split-order, is split into a separate order. Here’s the screenshots showing how it works :

Here’s the thank you/order received page showing 1 order split into 2 orders with 2 separate order numbers.

In the backend, go to WooCommerce orders and you’ll find 1 order for the product with the shipping class split-order and another for other products checked out.

Customer and admin emails are also split based on the orders. In this case 2 are sent for each.

Demo Video

Shows an order for 2 products, one of which is assigned the shipping class named split order. Once checkout is complete, the order shows as 2 separate orders on the order received page. The store owners WooCommerce > Orders page also shows the order split into 2 different orders and both the admin and customer received 2 emails, 1 for the split order product and another for other products added to the cart and completed checkout.

Tested using the Twenty Twenty Four default theme for WordPress however will work in any theme.

Installation

There’s 3 – 4 steps :

  1. Create a shipping class named Split Orders and make sure the slug is split-orders.
  2. Upload the folder named woocommerce to your child theme folder.
  3. Copy and paste the PHP code to the end of your child themes functions file or custom code snippets/functionality plugin.

Block Based Checkout

If using the block based checkout, you’ll need to follow an extra step.


Download Folder