• Hello OceanWP team,

    It’s Remy, the CTO of multilingual plugin. I’ve recently come across a small bug that when you are in a translated language, for example when you are on mywebsite.com/fr/ then small cart icon in the menu still have the link /cart instead of /fr/cart

    It’s funny because then, in the cart popup, the button “View Cart” has the correct link /fr/cart

    So I had a closer look to know why and found out the reason :
    – For the cart link on the small cart icon, you use directly get_permalink( $cart_id ) so it doesn’t trigger hooks.
    – For the cart popup, button “View Cart”, you use : wc_get_cart_url()
    With this, Weglot hooks that adds the /fr/ is called correctly

    My suggestion is to modify file woocommerce-helpers.php, line 49. Change
    $url = get_permalink( $cart_id );
    by
    $url = wc_get_cart_url();

    It should fix the issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello Remy,

    Thank you very much for your help. We will check the issue and update the file as you mentioned.

    Hello @remyb92,

    The code you provided:

    $url = wc_get_cart_url();

    Turned both icon and dropdown cart on our theme unaccessible.

    What we have done was to replace on code line 31 the original call replacing it by:

    $url = wc_get_cart_url( $cart_id );

    Which resolves the issue while keeping the theme features.

    Can you please confirm that this works for you?

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Compatibility Weglot, cart url’ is closed to new replies.