Okay
  Public Ticket #3137596
Cart In Nav: Links to wrong language (WPML)
Closed

Comments

  •  1
    Lubo started the conversation

    Hi,

    please try this:

    1. Open https://binchio.com/sk/produkt/binchio-premium/ (Slovak language version)
    2. Add the product to cart. That opens the side cart.
    3. Click on the Cart or Checkout button.
    4. It will redirect you to the default language URL (Czech), not the Slovak version.

    I believe that this is caused by cache since it does not happen when the user is logged in and the website is not cached.

    I don't know how to fix it though. Why is the cart cached? Is there something that can be done about it?

    Thank you.

    Best reards

    Lubo

  •  8,839
    Tahir replied

    Hey Again,

    1. Please clear your cache using this guide: https://themenectar.ticksy.com/article/6226/ .
    2. If you are using WP Rocket use this guide :  https://docs.wp-rocket.me/article/108-render-blocking-javascript-and-css-pagespeed#critical-path-css .
    3. For Woocommerce caching issues see: https://docs.woocommerce.com/document/configuring-caching-plugins/ . 

    Thanks


    ThemeNectar Support Team 

  •  1
    Lubo replied

    Hi. Sorry for the late reply, I didn't receive an email notification about your comment.

    1. I always delete the browser cache while testing caching issues.

    2. No, we use Autoptimize and WP Fastest Cache. I have tried deactivating Autoptimize while keeping WP Fastest cache and the problem still hapened. I have tried deactivating WP Fastest cache and activating WP Super cache and the issue still occured.

    3. I have followed the tutorial. It did not help.

    Thanks.

  •  1
    Lubo replied

    Hi again. I have found this ticket from a user using another theme, which EXACTLY describes my issue. I have tested my site now and it's true that when I add a product to cart from the homepage, it shows the links to cart and checkout correctly (and the products are in the right language and currency), but when I add the product to cart from the product detail page, it does not work as expected.

    https://xtemos.com/forums/topic/issue-found-with-checout-cart-links-with-wpml/

    It's strange that it works from the homepage, but not from single product pages.

    Is this something you guys can fix in your theme? Or is it a WPML issue? Your theme is supposed to be compatible :)

    Thank you again.

  •  8,839
    Tahir replied

    Hey Again,

    Try switching to the "Storefront" Theme and check to confirm if this is a Salient Issue. In the meantime i will escalate this ticket to the developer for further response. 

    Thanks 


    ThemeNectar Support Team 

  •  1
    Lubo replied

    Hi Tahir,

    with Storefront, the problem does not occur.

    Also, your theme uses AJAX search in the header, and the products there also have the wrong currency - even when logged in, so NOT using cache.

    I have found this: https://wpml.org/wcml-hook/wcml_load_multi_currency_in_ajax/ which fixed the issue (you should add it to your theme), so the products show the correct price in AJAX search, BUT only when logged in, so there is no cache. When the user is logged out, the search still shows the products with the wrong currency and the wrong link to the product.

    So this is the same issue as with the side cart.

    Also, in the past, I have had the same problem with another theme and I talked to WPML support about it. Then I found a setting in the theme to NOT cache the AJAX search results. That fixed the issue. So I know that this can be fixed. More here: https://wpml.org/forums/topic/split-search-results-return-wrong-currency/

    I truly believe that this is a Salient compatibility issue with WPML and your developers should look into it.

    Thank you.

  •  1
    Lubo replied

    OH MY GOSH. The issue was that there is this silly setting in WPML that I found about by accident when googling.

    I went to WPML -> Languages -> Language filtering for AJAX operations and checked "Store a language cookie to support language filtering for AJAX".

    This solved the issue both in the mini cart and in the header search.

    I don't understand why this setting is not on by default.

    Anyway, hopefully, this will help some other people who are getting crazy over this issue.