ruikaiW
|
Hi,
I have a site with 2 languages , EN as primary and ES as secondary
I have a product in both EN/ES language , they have product/post ID as 77, 81 , respectively
and from the frontend , they belong to a category , where EN product linked to category ID 18 , and ES product to cat ID 27
this is the background story
so , if I run this
`get_the_terms(77, 'product_cat');`
it returns 18 , this is correct and expected , English product ID gives English category ID
however, if I do it on post ID 81 , it still gives me category ID 18 , where I would expect it be 27 which is the Spanish category ID
is there any hook from WPML to get this ? I saw there is something for product/post , but couldn't find any about categories
Best regards,
|
Dražen
Supporter
Languages:
English (English )
Timezone:
Europe/Zagreb (GMT+01:00)
|
Hello,
you can try using the next hooks from WPML:
- https://wpml.org/wpml-hook/wpml_object_id/
- https://wpml.org/wpml-hook/wpml_get_element_translations/
Please check next ticket for more info:
- https://wpml.org/forums/topic/regarding-get_terms-function-in-multiple-language/#post-10983825
Hope it helps.
Drazen
|