I combined Woocommerce & Polylang to make multilingual shop.
The problem appeared, while I tried to display Shop page in other language than main one.
I solved the problem in the following way:
Add the code to your theme function.php file.
function get_woocommerce_shop_polylang() { return pll_get_post(get_option('woocommerce_shop_page_id' ) ); } add_filter('woocommerce_get_shop_page_id', "get_woocommerce_shop_polylang");
This function actually gets set Shop page id and converts to the current language version.
Hi Moishe Beshkin, than you for this article, i’m fighting with woo commerce and polylang, I can’t set the checkout in 2 languages, can you help me?
Alice,
Try the following code:
more information about ids here https://gist.github.com/Bradley-D/7287723
Sooo, maybe You know how to add some product in other language, because on product page is missing “language settings” area, I can find this option in normal page or post but not in a product page. ?! And thanks for great clues! 🙂
Kamil,
you need to go to Polylang settings page and enable translating of products. There will be checkboxes for products, products’ categories and other woocommerce items.
Thanks for fast and accurate suggestion! 😀
Hi Moishe,
Thanks for your article, it is what i was looking for!
I’ve added the code you mention to the “functions.php” file (i’m working with DIVI theme) but the shop in other language other than main one is still empty.
I have enabled all the product translation options in Polylang settings page, too.
Do you have any idea what else i could try?
Thanks in advance!!!
Best regards
Hi Moishe,
Im trying to make a multi languge site, with a multi language store as well.
the english is working fine, but changing to hebrew is not going well.
I think there is a language pack, but I dont know how woo triggers to use it.
Also, I need another store page in hebrew- cant use the same page with the name “shop”
can you please direct and guide me to the right path.
Toda Raba
Hi Moishe,
can I synchronize the stock and attributes from my products when I translate them to another language? It seems like I have to create a new product for the second language version and have different reference numbers for the same product. I’m struggling a lot.
Thank you so much for all your help!
Hello,
I’m integrating polylang with woocommerce too. I have the website in spanish and in english (default) and I’m having the problem that when I choose a product and press the button add to cart in one language (in spanish), it goes to the cart page but shows the cart page in english.
I have the cart and checkout pages in spanish and I can see them online with the correct language but they don’t work correctly in the process to buy a product.
Do you know how I can fix this? This is the product test link: https://sierraysol.com/product/explorando-la-alpujarra/
I changed some text in english and I had to set the translation still in spanish, so some words doesn’t find the translation and it shows them in english. Can it be the problem? Maybe It’s checking the text and it sees some words in english and it changes the cart page to a english language?
Could you give me any idea?
Thank you very much in advance
Perfect!! Thank u so much!!
It works great, but you gotta have the “Woocommerce Polylang Integration” plugin installed.
Hi there,
I have a problem setting my woocommerce in two languages. Currently, I am using the polylang to translate my site from Greek to English, but the Woocommerce creates me problems as I can only have one language.
Do you have any idea on how to add the “shop”, “My account”, “Cart” and “Checkout” in English (currently, as I said, my woocommerce pages are in Greek).
I would really welcome some help on this
Thank you mate.
Hi,
I activated the plugin “WooCommerce Polylang Integration” and now the second languages of cart and checkout is looking and working very good! BUT when proceeding to checkout I get a blank page both in the english version and second language.
How can we fix this so when proceeding to checkout it redirects to checkout???
Please help!!!
Kind regards
Louise 🙂
Thank you for the code it works great for me can someone say me how to have the same SKU for the same product but with other language because woocomerce dont allow more than one SKU per product even if it s the same product but in other language
Hi,
I’ve installed this plugin and everything works fine except when I translate products in my shop.
Appaerently the translation is associated to the product, when I save it and check the result it’s fine, I mean one product with the translations associated (in my case Spanish is the source language and my second languages are Italian and English). But when I select, in the stock info, that the product is sold out in the ITalian version, in the Spanish version it follows existing.
Actually, in the Spanish version, the products have a reference code that I would like to keep in the translations (because it’s the same product), but I get an error message saying that the reference code has be unique.
So it seems that the plugin consider the translations something like different product.
Any suggestions?
Thank you!