Home Forums WoodMart support forum Issue found with checout / cart links with WPML

Issue found with checout / cart links with WPML

Viewing 20 posts - 1 through 20 (of 20 total)
  • Author
    Posts
  • #146355

    ToriTori38
    Participant

    Hello,

    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 pages

    When 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

    #146364

    Artem Temos
    Keymaster

    Hello,

    Could you please check how it works with some default WordPress theme like twentysixteen to understand is it our theme issue or not?

    Regards

    #146422

    ToriTori38
    Participant

    Hello,

    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 you

    #146432

    Artem Temos
    Keymaster

    Could you please try to disable AJAX add to cart for product page in Theme Settings -> Product page?

    #146435

    ToriTori38
    Participant

    Hi 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.

    #146453

    Artem Temos
    Keymaster

    It seems that it doesn’t work with custom AJAX function so you will need to keep this option disabled.

    #146524

    ToriTori38
    Participant

    I 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.

    #146542

    Artem Temos
    Keymaster

    Could you please send us your FTP access?

    #146546

    ToriTori38
    Participant

    Hi 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).

    #146598

    ToriTori38
    Participant

    Hello 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.

    #146609

    Eric Watson
    Participant

    Hello,

    Try to edit the file wp-content/plugins/woocommerce-multilingual/inc/class-wcml-store-pages.php and replace this code

    if (
    			! $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 Studio

    #146613

    ToriTori38
    Participant

    Hello 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

    #146687

    Artem Temos
    Keymaster

    Hello,

    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

    #146688

    ToriTori38
    Participant

    Hello 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?

    #146699

    Artem Temos
    Keymaster

    Yes, you are right. But we hope that the issue will be resolved in the right way.

    #148469

    ToriTori38
    Participant

    Hello,

    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.

    #148486

    Artem Temos
    Keymaster

    We 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 🙂

    #148877

    ToriTori38
    Participant

    Hello 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.

    #148885

    Artem Temos
    Keymaster

    Hi,

    OK, thank you for informing us. Contact us when this will be resolved.

    Regards

    #150196

    ToriTori38
    Participant

    Quick 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.

Viewing 20 posts - 1 through 20 (of 20 total)