public function delete(&$product, $args = array())
{
$id = $product->get_id();
$post_type = $product->is_type('variation') ? 'product_variation' : 'product';
$args = wp_parse_args($args, array('force_delete' => false));
if ($args['force_delete']) {
wp_delete_post($product->get_id());
$product->set_id(0);
} else {
wp_trash_post($product->get_id());
$product->set_status('trash');
}
do_action('woocommerce_delete_' . $post_type, $id);
}