Home › Forums › WoodMart support forum › Issue found with checout / cart links with WPML
Issue found with checout / cart links with WPML
- This topic has 19 replies, 3 voices, and was last updated 5 years, 4 months ago by
ToriTori38.
-
AuthorPosts
-
September 24, 2019 at 2:02 pm #146355
ToriTori38ParticipantHello,
I have 3 languages on the site (using WPML) and English is my main site language. I have spotted a problem when adding products to the cart when I am on either the French or German pages.
From French or German pagesWhen I add a product to the cart from the home page, and then I want to go to the “Checkout” or “Cart” page, the Checkout and Cart link take me to the correct language version of those pages.
However if I repeat this from the single product page and add a product to the cart, the Checkout and Cart links take me to the English version of these pages which is not correct.
Do you know why this is happening? I have taken a screen video below to try and show you. In the video, please look at the page link in the bottom left corner when I hover the mouse over the cart / basket buttons. You will see what I mean. The cart / Checkout links should always take me to the French pages (.eu/fr), but it is trying to take me to the English pages (.eu) .
The problem is the same on the German pages.
Thank you
September 25, 2019 at 2:14 am #146364
Artem TemosKeymasterHello,
Could you please check how it works with some default WordPress theme like twentysixteen to understand is it our theme issue or not?
Regards
September 25, 2019 at 6:22 am #146422
ToriTori38ParticipantHello,
I have switched to the Tewnty Nineteen theme and the problem goes away. I then switched back to the Woodmart theme and deactivated most plugins and the problem still is there. So, it looks like it is a problem with your theme.
Can I ask you to please have a look. Here is some more information for you and a login to the site is provided below:
From home page
1. If you add any single product from the home page to you cart, on either of the secondary language pages (French or German), then the cart and checkout redirect to the correct language versions.2. If you add any variable product from the home page to you cart, on either of the secondary language pages (French or German), then the cart and checkout DO NOT redirect to the correct language versions.
From single product page
3. If you add any product from the single product page to you cart, on either of the secondary language pages (French or German), then the cart and checkout DO NOT redirect to the correct language versions.Hopefully that helps.
Thank youSeptember 25, 2019 at 6:42 am #146432
Artem TemosKeymasterCould you please try to disable AJAX add to cart for product page in Theme Settings -> Product page?
September 25, 2019 at 6:49 am #146435
ToriTori38ParticipantHi there,
Yes if I disable Ajax add to cart in theme settings, then the “see cart” link in the bottom bar redirects to the correct language page. So you have narrowed it down to an ajax issue with language pages.
September 25, 2019 at 11:24 am #146453
Artem TemosKeymasterIt seems that it doesn’t work with custom AJAX function so you will need to keep this option disabled.
September 25, 2019 at 11:28 am #146524
ToriTori38ParticipantI do not accept that reply Artem. I have bought this theme as it says it works with WPML. The Ajax functionality is essential for us.
Could you please ask Elise for her input on this.
September 25, 2019 at 12:23 pm #146542
Artem TemosKeymasterCould you please send us your FTP access?
September 25, 2019 at 12:41 pm #146546
ToriTori38ParticipantHi Artem,
Thank you for your reply and I appreciate you looking further at this. Please understand, from our side this ajax functionality is very important. That is one of the points that makes your theme so good.
Below are our ftp details. This issue cannot be unique to our setup so it must also be affecting other users with WPML (so hopefully you can find a stable fix quite soon).
September 25, 2019 at 2:48 pm #146598
ToriTori38ParticipantHello Artem,
Kindly please do not disable our CMP plugin whilst working on our site. This plugin blocks robots from browsing our site as it is being developed, and needs to stay published. I have enabled it again.
September 25, 2019 at 3:10 pm #146609
Eric WatsonParticipantHello,
Try to edit the file
wp-content/plugins/woocommerce-multilingual/inc/class-wcml-store-pages.php
and replace this codeif ( ! $is_admin || ( 'admin.php' === $pagenow && isset( $_GET['page'] ) && 'wc-settings' === $_GET['page'] ) ) { // Translate shop page ids $this->add_filter_to_get_shop_translated_page_id(); }
with this one
if ( ! $is_admin || ( isset( $_POST['action'] ) && $_POST['action'] === 'woodmart_ajax_add_to_cart' ) || ( 'admin.php' === $pagenow && isset( $_GET['page'] ) && 'wc-settings' === $_GET['page'] ) ) { // Translate shop page ids $this->add_filter_to_get_shop_translated_page_id(); }
as shown in the screenshot http://prntscr.com/pauyvg
Kind Regards
XTemos StudioSeptember 25, 2019 at 3:25 pm #146613
ToriTori38ParticipantHello Eric,
Thank you for looking at this.
Before I update the file a couple of questions:1. This issue is surely with all websites which use WPML (and WooCommerce multilingual) and your theme. Can you confirm that?
2. The file you are editing is not your plugin but that of WooCommerce multilingual. I am not so happy applying a hack to a plugin which is not even yours. Can you not make a code change in your plugin which would sort this problem?
3. If we apply this hack to WooCommerce multilingual, how do we keep it safe from future updates?
4. Will you in this case be reporting this issue to WooCommerce multilingual so they can update their core files?
Thank you
September 26, 2019 at 5:54 am #146687
Artem TemosKeymasterHello,
Yes, it is an issue with the latest version of the WPML and we will contact developers to resolve it in the next update in a proper way.
Kind Regards
September 26, 2019 at 5:59 am #146688
ToriTori38ParticipantHello Artem,
Thanks for your reply. Apopreciated. Could you kindly please confirm if I am correct with the following:
The patch you gave me for WPML should temporarily fix the problem. However this file will be overwritten by the next WPML (WooCommerce Multilingual) update. However you hope that the fix you have given me will be included in the next WooCommerce Multilingual update, once you have spoken with their developers. Is that about right?
September 26, 2019 at 6:13 am #146699
Artem TemosKeymasterYes, you are right. But we hope that the issue will be resolved in the right way.
October 4, 2019 at 4:55 pm #148469
ToriTori38ParticipantHello,
I just want to update you on this. I spent this last week working with several people from WPML to try and reporduce this error. Finally today their develoment team understood the issue and could reporduce it their end. They will provide a fix for this in the next version of WooCommerce Multilingual.
October 4, 2019 at 7:28 pm #148486
Artem TemosKeymasterWe are glad to hear that. We are talking about this issue with their team too. So now I’m sure that it will be fixed 🙂
October 7, 2019 at 11:01 am #148877
ToriTori38ParticipantHello again,
Today a person from WPML responded by saying he thought this was just a cache isue my side, not what he implied end of last week. I do not believe this is just a cache issue at all (all tests done via incognito browsers) and it has something to do with the Ajax of your plugin, cookies and the WooCommerce Multilingual plugin (which is not updating the URLs in the Ajax mini cart when switching between languages).
Anyhow, I have opened this ticket with WPML again as it is essential their devs find the issue and get it sorted.
October 7, 2019 at 11:16 am #148885
Artem TemosKeymasterHi,
OK, thank you for informing us. Contact us when this will be resolved.
Regards
October 15, 2019 at 1:19 pm #150196
ToriTori38ParticipantQuick update – WPML have managed to replciate the issue now and have sent the information to their dev team. They said however that it looks like it is an issue with the Woodmart theme.
They will update me once they have explored this further and let us know what needs to be done hopefully.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register