I am building a little plugin in Woocommerce to add some custom fields. It's very simple:
function save_option_fields($post_id) {
update_post_meta($post_id, '_energy', $_POST['_energy']);
update_post_meta($post_id, '_fat', $_POST['_fat']);
}
add_action( 'woocommerce_process_product_meta_simple', 'save_option_fields');
The problem is, since this metadata are only numbers, they don't need to be translated and I want to share them with all other languages on the site.
Right now, it works fine, but data is just saved for one language (or one post).
The site is using polylang plugin. I don't know if there's a WP/WC functions, or even from Polylabg itself, to address this.