• Hello!

    Im using WooCommerce in 5 different languages with a integration plugin for Polylang, everything works fine except for one little issue…

    Example:

    I choose english language from the page menu, I can navigate through the page and see the page in english, when I click on “My Account” it shows the info in english but when I click on the button “view order” it takes me to the italian version of “view order” (italian is the default language), but when I try to access the english “view order” page manually through the brownser it shows me the correct english page.

    Short explanation

    Chose the english language on my blog praecision.it
    Everything is translated to english
    Y click on “My Account” (praecision.it/en/my-account)
    Shows the info in english
    Click on “View Order”
    The link takes me to http://praecision.it/il-mio-conto/view-order/56
    And I have to access manually to the correct english URL http://praecision.it/en/my-account/view-order/56

    Any ideas please? thanks!

    https://wordpress.org/plugins/polylang/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,
    same problem for me, any idea?

    Thanks to jesperlundnielsen for this…

    In order to get Polylang to work YOU HAVE TO DO THIS. I’ve spent countless hours trying to fix this. I haven’t seen any functions or plugins out there that fixes this issue completely. Most pages “cart”, “checkout”, and “my-account” go back to the default translation without this fixed.

    1. You need to edit a file called wc-page-functions.php. You’ll need to use SSH or FTP to get into your WooCommerce installation. The path to the file is “wp-content/plugins/woocommerce/includes/wc-page-functions.php”

    2. Once inside the file search for the text “wc_get_page_id( $page )” You can do this by using CTRL-W with the SSH nano or just manually go looking for it with a text editor.

    3. Now search for the following text below.
    $page = apply_filters( 'woocommerce_get_' . $page . '_page_id', get_option('woocommerce_' . $page . '_page_id' ) );

    4. REPLACE THE FOLLOW LINE BELOW

    $page = apply_filters( 'woocommerce_get_' . $page . '_page_id', get_option('woocommerce_' . $page . '_page_id' ) );

    WITH THIS LINE

    $page = function_exists('pll_get_post') ? apply_filters( 'woocommerce_get_' . $page . '_page_id', pll_get_post ( get_option('woocommerce_' . $page . '_page_id' ) ) ) : apply_filters( 'woocommerce_get_' . $page . '_page_id', get_option('woocommerce_' . $page . '_page_id' ) );

    5. Save the file. You’ll need to do this every time you update WooCommerce since WooCommerce will overwrite the file. You may also need to reset file permissions to be able to update WooCommerce in the future by using something like “sudo chown -R apache:apache /var/www/html/” or w/e the path is.

    Now everything works! Products, product categories, checkout, cart, my-account, etc…

    For WooCommerce to work with Polylang you have to install an integration plugin such as this:

    https://github.com/decarvalhoaa/woo-poly-integration/releases

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Problem with WooCommerce links’ is closed to new replies.