public function update(&$product)
{
$post_data = array('ID' => $product->get_id(), 'post_content' => $product->get_description(), 'post_excerpt' => $product->get_short_description(), 'post_title' => $product->get_name(), 'post_parent' => $product->get_parent_id(), 'comment_status' => $product->get_reviews_allowed() ? 'open' : 'closed', 'post_status' => $product->get_status() ? $product->get_status() : 'publish', 'menu_order' => $product->get_menu_order());
wp_update_post($post_data);
$this->update_post_meta($product);
$this->update_terms($product);
$this->update_attributes($product);
$this->update_downloads($product);
$product->save_meta_data();
do_action('woocommerce_update_product', $product->get_id());
$product->apply_changes();
$this->update_version_and_type($product);
$this->update_term_counts($product);
$this->clear_caches($product);
}