1. Documentation
  2. Plugins
  3. WooCommerce
  4. Extensions

Clone Orders

The Clone Orders extension adds functionality for duplicating orders to streamline the process of adding similar orders quickly. The clone will be assigned to the same customer with shipping and billing details copied from the original order.

Installation and Setup ↑ Back to top

  1. Download the .zip file from your WooCommerce account.
  2. Go to: WordPress Admin > Plugins > Add New and Upload Plugin with the file you downloaded with Choose File.
  3. Install Now and Activate the extension.

More information at: Install and Activate Plugins/Extensions.

After activating the extension, the clone order function will be available for use on all orders, no additional configuration is necessary.

Usage ↑ Back to top

To clone an order:

  1. Go to WooCommerce > Orders in the WordPress admin, and open the order you wish to clone
  2. Click the Clone order button, which appears in the action buttons below the list of line items
    Order line items clone button
  3. The dialog (shown below) will open. Select whether to include the line items in the clone or not.
  4. Click the Complete clone button to confirm
  5. A new order will be created as a clone of the original. A link to the new order will be displayed in the confirmation notice, to allow you to navigate straight to it.

An alternative method of cloning from the order listing screen is available using the two clone buttons in the Actions column. There is one button to clone with line items and another to clone without them.

Order listing clone buttons

Additional fields ↑ Back to top

By default, non-standard fields will not be copied when performing a clone. This is because many fields are specific to the individual order (for example order tracking data or a sequential order number), and it would be inappropriate to copy them. However if you do have additional fields you would like included in a clone, these can be added by listing them on the settings page at WooCommerce > Advanced > Clone orders.

Clone orders settings screen

FAQs ↑ Back to top

What data is copied to a clone order? ↑ Back to top

The following data is copied to a clone:

  • Line items (optionally) – including products, fees, shipping, coupons
  • Line item meta
  • Order status
  • Customer
  • Billing address
  • Shipping address
  • Customer note
  • Date created
  • Tax status
  • Customer IP
  • Customer user agent

What data is not copied to a clone order? ↑ Back to top

  • Order notes are not copied to the new order
  • Order meta data added by other plugins will not be copied by default. Additional meta data fields can be input on the settings page to have them included in the clone. Note that although order meta is not copied to the clone, all line item meta is copied.

Are customer emails sent when an order is cloned? ↑ Back to top

To avoid customer confusion, the default WooCommerce emails are prevented from sending during a clone. This includes the following:

  • Customer – processing order
  • Customer – completed order
  • Customer – refunded order
  • Customer – on-hold order

The following admin emails are also disabled during a clone:

  • Admin – new order
  • Admin – cancelled order
  • Admin – failed order

If you have additional email types added by other plugins, that are triggered by the creation of an order, then they could still be sent.

Are stock levels reduced when an order is cloned with items? ↑ Back to top

Yes. If the status of the new order will be one of processing, completed or on-hold, then the stock levels will be reduced for any line items included in the clone. This default functionality can be prevented using a code snippet.

Does the extension support sequential order numbers? ↑ Back to top

Yes. The plugin supports the Sequential Order Numbers Pro extension, so cloned orders will be assigned order numbers as defined in your settings for that extension.

Code Snippets ↑ Back to top

These snippets are intended for use by developers. To use them you will need to add the code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin.

Restore emails when cloning ↑ Back to top

By default WooCommerce emails are disabled as part of a clone. If you want them to be enabled you can use the following snippet:

add_filter( 'vibe_clone_orders_disable_emails', '__return_false' );

Copy meta data to the new order ↑ Back to top

It is no longer necessary to use a code snippet to include meta data in a clone. Meta data fields can be added on the settings page to be copied to the clone.

 

Prevent line item meta data being cloned ↑ Back to top

If you clone with line items, any meta data attached to the line items is also copied. If you wish to prevent this happening for specific meta fields you can do this using the following code snippet.

function clone_line_item( $target_item, $source_item, $target_order, $source_order ) {
   $target_item->delete_meta_data( 'my_item_meta' );

   return $target_item;
}
add_filter( 'vibe_clone_orders_line_item', 'clone_line_item', 10, 4 );

Set status of new order ↑ Back to top

By default the status assigned to a clone is the same as the original order. To set the status of all clones to ‘pending’ the following snippet can be used:

function clone_order_status( $status ) {
    return 'pending';
}
add_filter( 'vibe_clone_orders_clone_order_status', 'clone_order_status' );

Prevent the date and time being cloned ↑ Back to top

The date and time will be copied from the original order. Depending on your use case, you may prefer the new order to be set to the current date and time. The following snippet will do this.

add_filter( 'vibe_clone_orders_clone_date_created', '__return_false' );

Prevent stock levels being reduced ↑ Back to top

By default, when performing a clone, stock levels will be reduced for any line items in the order, only if the order status of the clone is one of processing, completed or on-hold. The following code snippet will prevent stock levels from being updated.

add_filter( 'vibe_clone_orders_reduce_stock', '__return_false' );

Reduce stock levels for custom order statuses ↑ Back to top

By default, stock levels will only be reduced for orders with a status of processing, completed or on-hold to be consistent with WooCommerce core. If you want stock levels to be reduced for other statuses too, including any custom statuses you are using, then the following code snippet will do this. This will add ‘picking’ and ‘shipping’ to the statuses that will trigger stock reductions in clones.

function clone_orders_reduce_stock( $should_reduce_stock, $new_order ) {
$statuses = array( 'picking', 'shipping' );

return $should_reduce_stock || in_array( $new_order->get_status(), $statuses );
}
add_filter( 'vibe_clone_orders_reduce_stock', 'clone_orders_reduce_stock', 10, 2 );

WooCommerce - the most customizable eCommerce platform for building your online business.

  • 30 day money back guarantee
  • Support teams across the world
  • Safe & Secure online payment