Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Woocommerce products can not be queried in another language #847

Open
cankahya opened this issue May 2, 2024 · 4 comments
Open

Woocommerce products can not be queried in another language #847

cankahya opened this issue May 2, 2024 · 4 comments

Comments

@cankahya
Copy link

cankahya commented May 2, 2024

Describe the bug
It is not possible to query woocommerce products for another locale, using wp-graphql-wpml

To Reproduce
The following query should return the english versions of the products. Instead it returns the main locale (german in this case):
Query
{ products(where: {wpmlLanguage: "en"}) { nodes { id slug name ... on SimpleProduct { id name buecherFields { buchKategorien { nodes { name slug } } } buchInfos { buchInfos } locale { locale id } } } } }

Response

{
"data": {
"products": {
"nodes": [
{
"id": "cHJvZHVjdDoxMDE4Mg==",
"slug": "sollberger-boegli",
"name": "Sollberger Bögli",
"buecherFields": {
"buchKategorien": {
"nodes": [
{
"name": "De aedibus",
"slug": "de-aedibus"
}
]
}
},
"buchInfos": {
"buchInfos": "

Herausgegeben von: Heinz Wirz
\nTextbeitrag: Katharina Marchal

\n"
},
"locale": {
"locale": "de_DE",
"id": "de_DE"
}
},
....

Expected behavior
The products should be returned in english.

Screenshots
Bildschirmfoto 2024-05-02 um 19 42 38

Desktop (please complete the following information):

  • OS: macOs
  • Browser Chrome
  • Version 124.0.6367.118 (Offizieller Build) (arm64)

Plugin Versions
Bildschirmfoto 2024-05-02 um 19 43 44

@cankahya
Copy link
Author

cankahya commented May 2, 2024

Not sure if this is a bug with wp-graphql-wpml or wp-graphql-woocommerce. Clarifcation would be great!

This is a very crucial feature, which makes the use of graphql for multilangual woocommerce sites impossible.
Please priotize. Also happy Thanks for any tip!

@creative-andrew
Copy link
Contributor

@cankahya I think it might be an issue with wp-graphql-wpml as wp-graphql-woocommerce doesn't interact with translations. Have you tried to contact wpml?

@creative-andrew
Copy link
Contributor

creative-andrew commented May 8, 2024

I've also noticed that you are using this version https://github.com/rburgst/wp-graphql-wpml, which seems to be unmaintained.

Have you tried with the official one from here https://wpml.org/documentation/related-projects/wpml-graphql/?

Their version is from 2023 https://wpml.org/compatibility/2023/05/wpml-graphql-build-headless-multilingual-wordpress-sites/

@cankahya
Copy link
Author

cankahya commented May 9, 2024

@creative-andrew Thanks for taking your time looking into this. I will test the plugin you suggested and report my findings :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants