Skip Navigation

[Resolved] Toolset view not showing results in secondary language

This support ticket is created 3 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 22 replies, has 2 voices.

Last updated by jelle-jacobd 3 years, 3 months ago.

Assisted by: Nigel.

Author
Posts
#2170369

Hi, I have a problem with a taxonomy/attribute view. The view below shows the results (icons) selected for this specific product in the primary language (EN). Unfortunately not for the secondary language (NL). I'm using WPML, all others views are working fine, so it seems nothing wrong with WPML settings as it seems.

Used view: Product Icons > hidden link

All taxonomy values ​​have been copied/translated to the second language, including the images for the custom field. Any idea what could be going on here?

Product example primary language:
hidden link

Screenshot location icons view:
hidden link

Product example secondary language:
hidden link

Screenshot location icon view (nog geen iconen beschikbaar/no icons available):
hidden link

Taxonomy translation:
hidden link

Values are added to translated product (I used WooCommerce Multilingual to translate the products as advised):

Attribute values primary language:
hidden link

Attribute values secondary language:
hidden link

Staging site can be a little slow. I disabled caching for testing purposes.

Thanks!

Br, Jelle

#2171011

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Jelle

I running some tests with a similar set up on my own local site, I'll update again when I see whether I can reproduce the problem (or solve it).

#2171025

Hi Nigel,

Great, thanks a lot! Looking forward to it:)

Br, Jelle

#2171039

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I'm not running into any problems yet on my local site, so I started to check the set up on your site but I'm not quite sure what I'm looking at.

The View is to show "Product Icon" terms assigned to the current post, and the pages where this View is being used are on single product posts, i.e. the View should show Product Icon terms assigned to the current product.

If I edit a single product, I don't see Product Icons as a taxonomy in the sidebar where I can set terms.

If I go to Toolset > Taxonomies I can see an Icon taxonomy, which is deactivated.

Where do these product icon terms come from? How can I see what terms are assigned to a post?

#2171237

Hi Nigel,

Thanks. Taxanomies are added as product attributes in this case icons. So they are not on the right side. I have added the screenshot in my initial post. Thing is that it works for the primary language, but not for the secondary language.

Br, Jelle

#2171787

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

OK, I set up the same on my local test site with product attributes, went through the steps of translating them etc., and it also works correctly both in the original language and the translation.

Let me nose around in your site to see if I can spot the problem.

#2171819

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2021-09-17 at 11.04.08.png

When I go to WooCommerce > WooCommerce Multilingual and switch to the Attributes tab I get a JS error when selecting the Icons attribute, as shown in the screenshot.

(I had already disabled the UpSolution Core plugin which was also generating errors on the same page.)

The error is

Uncaught TypeError: can't access property "flag", TaxonomyTranslation.data.allLanguages[labelLang] is undefined       label-row-view.js:39:6

I think you would be best placed reporting that error to WPML support, and then returning here when it is resolved and we are able to use that page as intended.

The first thing they are likely to want you to do is to disable all plugins except WPML plugins and WC as well as switching to a default theme and test again, so you might want to check that first. I can do that part for you if you'd like, let me know if it is okay to do that on this staging site.

#2171837

Hi Nigel,

Thanks for letting me know. I will report the error. Should I contact my theme author as well?

Yes please go ahead testing with default plugins and theme. Looking forward to your findings.

Thanks in advance!

Br, Jelle

#2171843

Hi Nigel,

Thank you for letting me know.
Yes, of course. Please go ahead, looking forward to your findings.

Br, Jelle

#2171853

Hi Nigel,

Sorry for the duplicate message, seems like something went wrong answering your message.

Br, Jelle

#2171901

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I've done some testing and having identified the problem yet, and I've taken a copy of the site to install locally where I can test it more easily without worrying about breaking anything on your site.

#2171929

Hi Nigel,

Thanks again:) Is it possible that the header/navigation bar not showing up on the product detail page in the secondary language is somehow related to this issue? The header/navigation bar is available on category/archive pages and regular pages.

Br, Jelle

#2171969

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I seemed to have it working, but I'm not sure which of the changes I made are responsible, so I'm re-setting the site and will work through the changes again.

#2172035

Oke, thanks for the update. Really curious what was causing the issue:)

Good luck!

Br, Jelle

#2173741

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Before making any kind of changes related to translating the terms, I made your site as "vanilla" as possible, switching theme to twentytwentyone and disabling most non-Toolset or WPML plugins, except for WooCommerce and "WooThumbs for WooCommerce by Iconic", which I guess adds the product attributes for the icons.

I'm not sure how you created templates for products—not with Toolset, it seems—so I created a Content Template for Single Products, and added your View product-icons to it, as well as a similar View I created myself for testing.

On that basis I was able to determine that the problem occurs because of the ordering setting of your View.

It is set to order by a term meta field "order".

Changing that to, say, order by the term name resolves the problem.

Where on the Dutch page it shows a message that there are no icons to display, the reason is how ordering affects WordPress queries (actually, the underlying mySQL queries), namely that if there is no value for the thing being used to order results then that post (or in this case, taxonomy term) is not included in the query results.

That means that in the original language there are values being reported for the order term meta, but in Dutch no values are being returned.

I need to look into this a little further to understand whether the problem relates to the WPML settings—is there a setting we can change so that values are reported for the term meta field in Dutch—or whether it relates to how Views formulates the query.

Can I ask, where are these order term meta fields set up, and have you done anything particular in terms of applying settings to them in WPML?