• Resolved unicco

    (@unicco)


    Hi,

    I’m currently working on a new project, and have encountered an issue with the text in minicart, that doesn’t change language/text on lang-switch.

    In my troubleshootingproces; I’ve figured out, that the problem might be related to some caching. If I set the language to EN, ‘cart’ is displayed correctly, while if I change language to DA (with the lang-switch button), the text aren’t changing. If I clear the cache (while DA is set), and refresh site, the minicart displays danish text (which is correct).

    Watch the function here.

    I’ve tried playing around with Custom Integration, with the classes-field, but it dont help me out. Likewise Compatibility Functions doesn’t help.

    You can see the site running, but you’ve to change the vhost-file to point to 91.121.165.163 https://www.ejstruplys.dk.

    Hope you guys can help me out.

    Specs:
    Avada-theme
    Memcache

    https://www.ads-software.com/plugins/qtranslate-x/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Gunu

    (@grafcom)

    @unicco

    I’m currently working on a similar problem on my test site. I will keep you also posted about the progress.

    Thread Starter unicco

    (@unicco)

    Perfect!

    Plugin Author Gunu

    (@grafcom)

    @unicco

    there are no other problems with changing the languages?

    For example, if some prouct is in your cart, the language switching works well?

    Do you use http or https ?

    Thread Starter unicco

    (@unicco)

    http atm.

    Yes, the producttitle is displayed as:
    “[:da]dansk[:en]engelsk[:no]norsk[:sv]svensk[:de]tysk[:]”

    So it’s basically everything with the minicart that are troubling.

    You can see it at 91.121.165.163 https://www.ejstruplys.dk.

    Thread Starter unicco

    (@unicco)

    How are things working out ? ??

    Plugin Author Gunu

    (@grafcom)

    @unicco
    I discussed it with John:

    Woocommerce stores minicart in session variable already translated, there is no way to change language. Normally, users do not switch language during shopping, so we think it is not a big problem.

    I hope this helps.

    Thread Starter unicco

    (@unicco)

    Oh, thats seems right. I’ve just tried changing language, and adding an item to cart. After the item has been added, and the cart’s total have been calcucated, the correct language is displayed in the minicart. It only becomes a problem, in that period where the users change language, to he actually puts something in the cart.

    Guess I’ve to live with this. Thanks anyways.

    Hello. I have the same problem and I posted about this also to:
    https://qtranslate-x.com/support/index.php?topic=127.0

    I wrote there:

    Hello.
    I am having exactly the same problem.
    Have You tried to fix that problem?
    Actually I am not 100% sure if qtranslate-x team is responsible for that, but if you said, that you will look that, then I am very interested of that solution. I have also looked the code myself and tried to fix that, but without success. You can check my site at https://start.messenger.ee/demod/demo1/?lang=en where the problem exists.

    Can someone please help us? Maybe there is some simple fix about this problem?

    Kristjan

    Plugin Author John Clause

    (@johnclause)

    Thread Starter unicco

    (@unicco)

    Hi kristjan683,

    It’s pretty long time sense I fixed this issue, so it’s pretty blurry what I exactly made of changes.
    I’m using Avada theme – they might have fixed it already, not sure of that.
    Anyways, I changed the .js theme file located in /themes/Avada/assets/js/wc-cart-fragments.js to this:
    https://gist.github.com/unicco33/e11747836cb51a80128faae3ce0db3f6

    In /themes/avada/class-avada-scripts.php on line 49 I commented this out:
    if( class_exists( ‘WooCommerce’ ) && class_exists( ‘SitePress’ ) ) {

    The condition was never true, so

    wp_deregister_script( ‘wc-cart-fragments’ );
    wp_register_script( ‘wc-cart-fragments’, get_template_directory_uri() . ‘/assets/js/wc-cart-fragments.js’, array( ‘jquery’, ‘jquery-cookie’ ), $theme_info->get( ‘Version’ ), true );

    was never executed.

    It might be different, ofcourse, if you’re using other themes. Hope this helps.

    Plugin Author John Clause

    (@johnclause)

    Thank you @unicco, I created an issue: https://github.com/qTranslate-Team/woocommerce-qtranslate-x/issues/27, so that we would not forget it.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Minicart doesn't change language on lang-switch’ is closed to new replies.