I have a website using WooCommerce in the Slovenian language that is being translated with WPML into multiple languages and English will become the default one. Products were all set in Slovenian language and use a custom field (ACF) for an image. The products are translated but the images are duplicated which causes issues in one case. The image should be of the original product.
I have now fixed this by using this:
$preview_img_id = get_field( 'preview_image', apply_filters( 'wpml_object_id', get_the_ID(), 'product', FALSE, 'sl' ) );
But this is not a good solution in the long term because new products might be added in another language first.
What function can I use to get the ID of the original post/product?