Skip Navigation
availability:

WooCommerce Multilingual Version: 3.5

description:

Run actions after duplicating a product.

type:
action
category:
Inserting Content
parameters:
add_action( 'wcml_after_duplicate_product', 'the_callback_function', 10, 2 );

There are two parameters being passed to this action:

$new_id
(integer) The ID of new product.
$post_to_duplicate
(object) The original post data to duplicate.
hook example usage:

Example

add_action( 'wcml_after_duplicate_product', 'my_custom_action', 10, 2 );

function my_custom_action( $original_product_id, $new_id, $post_to_duplicate ) {

	// my custom action

}