WooCommerce Get Product Category with Language Code WPML
Today, let’s discuss through an illustration the way through which you can get a WooCommerce Product Category with language code using the WPML module. The example below will get translated product category id of the given language. However, this code functions with the installed WPML module.
Below is an example:
$langCode = 'fr';
$productCatId = 20;
$productCat = icl_object_id($productCatId,'product_cat',false,$langCode);
$productCatId = 20;
$productCat = icl_object_id($productCatId,'product_cat',false,$langCode);