Hey there I am a developer of a plugin that creates ands syncs products from accounting system. My clients can change the prices of the products in the accounting system but for some reason the prices do not update on your translated product, only the original product. here is an broken down code of how i create or update the product i basically receive a json representation of the product from accounts system and create or update the product in woo.
public function create_or_update_product($product) {
if(empty($objProduct)){
$objProduct = new WC_Product();
}
/* … buch of code that set up other aspects of the product*/
$objProduct->set_regular_price($product->listPrice);
$objProduct->set_sale_price($sale_price);
if($product->variants){
/* creates variations of the product */
}
if(!empty($objProduct->get_changes())) {
$this->track_load('product_save');
$objProductId = $objProduct->save();
$this->track_load_end('product_save');
}
/* … buch of code that set up other aspects of the product*/
here is the code that handles creating the translations $translated_product_id = apply_filters( 'wpml_object_id', $objProduct->get_id(), 'product', false, 'en' );