I am trying to use http://docs.woothemes.com/wc-apidocs/source-class-WC_Admin_Duplicate_Product.html#15-235 in functions.php but it does not work.
$wcx = new WC_Admin_Duplicate_Product;
$product = $wcx->duplicate_product('14466'));
print_r($product);
This gives me a blank page
You need to change the method name to “product_duplicate()” and use “wc_get_product()” instead of “get_post()”
You need to use a wordpress post object as the parameter, not the post ID.
Example: