product_duplicate

Triggered on creation of a duplicate product and allows modification of its properties.

Shop-Script

Input (passed by reference)

$params['product'] shopProduct Original product properties object. Can be modified by plugins.
$params['duplicate'] shopProduct Duplicate product properties object. Can be modified by plugins.
… your plugin code …

Output

Shop-Script

Plugin code example

PHP

public function productDuplicate(&$params)
{
    /** @var shopProduct $product */
    $product = $params['product'];

    /** @var shopProduct $duplicate */
    $duplicate = $params['duplicate'];

    $duplicate->name = $product->name . sprintf(' (%s)', _wp('duplicate'));
    $duplicate->save();
}