This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 5 replies, has 2 voices.

Last updated by Bruno 4 months, 3 weeks ago.

Assigned support staff: Bruno.

Author Posts
May 21, 2019 at 2:57 pm #3856427

jenniferG-10

I can switch off in the taxonomies that product categories are not being translated. I need this function just for selected product categories. I am sure this is possible with the custom xml configuration but every code that I tried didn't work. Can you help me using this function for selected product categories?

May 21, 2019 at 9:40 pm #3858929

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Thank you for contacting us. I would be very happy to help you but I didn't fully understand what is the issue.

Can you please elaborate a little more so I can better understand? Sometimes screenshots illustrating what you mean may go a long way to clarify what words fail to transmit so if you like make use of "upload an image" below the comment area.

Thank you.

May 22, 2019 at 6:48 am #3861545

jenniferG-10

Hi Bruno,
Sure. Please see the screenshot attached. Basically, I need a code or a function on how to use that function for only selected categories and not all of them. Do you have a code for me that I can add to custom xml or something how I can activate it for only selected categories?

May 22, 2019 at 9:27 pm #3869341

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi,

Thank you. Unfortunately, this does not seem to be possible. WPML works only based on taxonomy (product_cat, categories, product_tag, tags, etc) and post types. That is, individually selecting specific categories should not work through Custom XML.

To do this, I believe you need to use custom coding which is not just a custom xml. You can see more in our documentation: https://wpml.org/documentation/support/language-configuration-files/#custom-taxonomies

Thank you.

May 23, 2019 at 7:11 am #3871921

jenniferG-10

Hi,
Thanks for your reply. Yes, I already tried that but I must have a mistake in my code. If you could have a look at it that would be so lovely. Here is an example of the categories that I added to the custom XML. The first one should be translated and the second should not. What am I doing wrong?

<wpml-config>
<taxonomies>
<taxonomy translate="1">accessoire-tasche</taxonomy>
<taxonomy translate="0">accessoire-tasche-monogramm</taxonomy>
</taxonomies>
</wpml-config>

May 23, 2019 at 10:27 pm #3879691

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi,

For your code, you are trying to specify a taxonomy. WPML will only work with the base taxonomy (and will have the same effect on all defined terms - all categories, for example).

That is, WPML does not work using a specific category, just all categories of a taxonomy. For example, the "product_cat" is the WooCommerce taxonomy for product categories, so:

<wpml-config>
    <taxonomies>
        <taxonomy translate="1">product_cat</taxonomy>
    </taxonomies>
</wpml-config>

As you're wanting to do this for a specific category (one category inside the product_cat - Products > Categories), then you would need custom coding (not just custom XML).

Note that as this is a custom feature, unfortunately, this is beyond the scope of our support.

We have a list of WPML and WooCommerce Multilingual hooks that can help you develop such feature, which can be seen in the links below:

- https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference
- https://wpml.org/documentation/related-projects/woocommerce-multilingual/wcml-hooks-reference/

If you prefer, you can contact one of our certified partners who can develop small to large features for your site: http://wpml.org/documentation/support/wpml-contractors/

Thank you.