protected function update_terms(&$product)
{
wp_set_post_terms($product->get_id(), $product->get_category_ids('edit'), 'product_cat', false);
wp_set_post_terms($product->get_id(), $product->get_tag_ids('edit'), 'product_tag', false);
wp_set_post_terms($product->get_id(), array($product->get_shipping_class_id('edit')), 'product_shipping_class', false);
}