-
Notifications
You must be signed in to change notification settings - Fork 67
Problem with shop translation #400
Comments
Sorry, but I hadn't seen the previous comments. This fixed it: Begin quoted post: I had changed Pages.php public function translateShopUrl($url, $language) Now all work as expected |
@Ketuax I also have not seen the previous comments. What is the final code you are using? as the quoted code is incomplete and incorrect syntax |
Hi, here's what I did to fix the problem. From this part of the code in pages.php if ($shopPage) {
I removed the word "Translation" from the last line. The problem occurs when the page url contains the word "shop" as part of the company name. In my case it was Kypseli Workshop (www.kypseliworkshop.gr). Then the plugin goes and replaces the word "shop", with the slug translation. I do not know php so I cannot say if this is correct coding but it solved my problem. I hope this helps. |
ok with that change that bit of code would do nothing, which only works in your case because the shop page in both languages has the same slug "shop", so this is not a general purpose fix. What it should do is only replace the last occurrence of the post_name (or not at all if both post names are the same...) |
Hello,
my name is Katerina and I am just about to complete my first shop page www.kypseliworkshop.gr. I have a very weird thing happening with my website and it would be great if you could help.
I have a shop page in greek: https://www.kypseliworkshop.gr/gr/shop/
And a translated shop page in english: https://www.kypseliworkshop.gr/en/shop-2/
When I'm on the greek shop page trying to go to the english one it requests this link: https://www.kypseliworkshop-2.gr/el/shop-2/
I have tried with many names for the shop but what always happens is that it replaces the word "shop" in the main url (www.kypseliworkshop.gr) with whatever the english shop slug is. So if the slug is 'tree' then the requested url becomes www.kypseliworktree.gr/el/tree. This only happens in this case, i.e. only from the specified woocommerce shop page to the translated shop page. Not the other way round, not for any other page or product.
I disabled the woo-poly integration plugin and the language switching and everything else works fine.
(I have now turned it back on so you can see what happens)
Steps to Reproduce
What I Expected
To go to the english shop page
What Happened Instead
Server not found error. The link requested was: https://www.kypseliworkshop-2.gr/el/shop-2/
instead of: https://www.kypseliworkshop.gr/en/shop-2/
The text was updated successfully, but these errors were encountered: