[Resolved] Issue with plugin "product tabs" from Barn2
This thread is resolved. Here is a description of the problem and solution.
Problem: You are using WPML with a two-language setup (DK and SE) and the Barn2 product tabs plugin. While global tabs and their labels translate correctly, product-specific tab content does not appear in the SE version. Solution: First, ensure the visibility of the 'Screen Options' panel by adding the following CSS rule in WPML → Languages → Language switcher options → Additional CSS:
Next, ensure the Tab ID (slug) is identical across languages by either creating new tabs with the same title in both languages or editing existing tabs to manually set the same slug. Remember, if you change the slug, you must re-edit the product and re-add the custom tab content. Finally, set the custom fields: • _wpt_override_ to Copy • _wpt_field_ to Translate This setup ensures that the product and its translation share the same custom field setup.
If this solution does not resolve your issue or seems outdated, please check the related known issues, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If necessary, do not hesitate to open a new support ticket.
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.
- Does this mean I have to make new Tabs for the Danish products or only the Swedish?
Not necessarily, you can adjust existing ones.
- When I manually create new Swedish Tabs and give them the same title as in the Danish products, wil they then automaticaly get same IDs/Slugs as the Danish ones? I thought new tabs would always get new IDs/Slugs?
I just re-tested. Yes, you are right, it was like that before. Now, they always get new IDs/Slugs (taken from post ID).
- When the ID/Slugs are identical, can I then rename the Tabs, for the Swedish products after the ID/Slugs have been set?
The most important point is to keep the tab slug the same between the original and its translation. The tab's title can be different.
Basically, the steps are the same as above:
1. Create the tab in the original language (if you go with new tabs).
2. Translate the tab into the secondary language.
3. Manually adjust the tab slug in the translation so it matches the original tab’s slug.
4. Assign the tab to the product and test the result
(assuming the related custom fields are configured as described earlier).
I can see that you already renamed the slugs of one of the tabs. So I renamed the other tab to match the danish ID/Slug.
I updated the custom fields settings so one tab will be translated and the other one will be copied (this tab is ingredients and does not need translation)
Then I did a change to a translated product in the original language and updated the translation, and then the two tabs very ready in the Swedish version 🙂
I translated a new product and now the tabs just work out of the box.
So I did not have to asign any tabs to any products, as you have written in step 4 in the latest procedure. It just works with renaming the slugs/IDs and updating the translation.
It seems to work now, even though I did not follow your instructions 100%. Do you see any potential issues or mistakes in the procedure I have described above?
I’m glad to hear it’s working — if it works, it works 🙂
There’s really no other required setup in this case, so I don’t see any potential issues.
So I did not have to asign any tabs to any products, as you have written in step 4 in the latest procedure. It just works with renaming the slugs/IDs and updating the translation
In this case, I likely missed a detail in how the WooCommerce Product Tabs plugin is configured on your site. You can safely ignore that step.
One hopefully final question. I have set the custom field _wpt_field_wpt-35337 to "COPY" because I would like to copy content from the Danish tab to the Swedish tab. But it seems to "jump back" to "TRANSLATE" after doing some product translations/syncs. Moving this back and forth triggers naturally some sync issues on the products. So questions is, why does it "jump back" to "TRANSLATE" after I set it to "COPY" and saved. I have seen this issue multiple times now.
I suspect the plugin author has configured this field to be translatable by default, since that’s usually what most users expect. That could explain why the value appears to “jump” or change unexpectedly.
As a workaround, I recommend locking this field via a WPML configuration, so its value is always copied from the original language instead of being translated.
Please try adding the following configuration in
WPML → Settings → Custom XML Configuration:
Now I have tested for some days, and it seems like the custom field is now locked to "COPY" after adding the code you provided.
For some of the products the custom field is missing after translation, but if I run the translation once more it shows up on the product - I just need to check all products for this field to be sure.
I can see that all the products are marked for resync shortly after translation. I guess this has something to do with the code forcing the field to be "COPY" - what do you think?
I can live with this "out-of-sync" status for the products, but du you see any problems with the products being out-of-sync constantly?
I’m glad to hear that the custom field is now locked and working as expected.
I can see that all the products are marked for resync shortly after translation. I guess this has something to do with the code forcing the field to be "COPY" - what do you think?
Could you please upload a screenshot showing what you’re seeing? This will help me make sure I understand this correctly and give you a more accurate answer.
All these products have not been changed since translation but as you can see they are marked as "Resync needed". My guess is that this has something to do with the field we have now locked to "Copy" - but I don't know, it is just a guess.
Yes, this indicates the translation needs to be updated because the original content has changed.
The existing translations will still work and will continue to be displayed on the site, so you can leave them as is if everything looks fine. However, if you notice something missing or outdated in the translation, you’ll need to either send it for translation or open the translation editor to complete it to sync the latest changes.