Support » Plugin: Multisite Language Switcher » Page Link issue

  • Resolved vero.nika

    (@veronika-1)


    Hi Dennis,
    I have two sites running in a multisites Wp installation.
    I installed your plugin and I have already configurated it in both my sites but I am having an issue. I cannot set the pages switch…I mean, when in the first site I try to set the equivalent second site page from the select menù and I click “update”, what I get is a empty field in the select menù, as if I woudn’t have change anything.
    In fact, when i click in the first site frontend page flag icon, the link directs to the home page of the second site and not to the equivalent page.
    Hope you can understand the problem and help, please tell me if you need further infomation.
    Thank you in advance.

    Veronica

    http://wordpress.org/plugins/multisite-language-switcher/

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Dennis Ploetner

    (@realloc)

    Have you finished the setup for the languages in your sites in Settings > General? Seems that you have 2 sites with the same language. Read on here:

    https://github.com/lloc/Multisite-Language-Switcher/wiki/Plugin-installation-and-activation#2-choose-the-blog-language

    Cheers,
    Dennis.

    Hi Dennis
    thank you for your prompt answer and sorry for my late reply.
    I followed your suggestion and now it seems to work but there is another problem.
    Into Woocommerce items it works from the English version (primary site)to the italian site (network site) but not from the italian to the english one. In the second case it links to the same italian page instead of the english one.
    Do I miss anything?
    Thank you

    Veronica

    Plugin Author Dennis Ploetner

    (@realloc)

    Ciao Veronica,

    I don’t know how Woocommerce works but I will check if there is a problem during this weekend.

    Cheers,
    Dennis.

    Ok, thank you in advance Dennis for your kind support.
    I’ll be waiting for your check. Please write if you need an access to have a quick look to the issue.
    Cheers,

    Veronica

    Plugin Author Dennis Ploetner

    (@realloc)

    I tested WooCommerce and there is indeed a problem with the generated URLs. Read on here and let me know if this resolves your problem: https://github.com/lloc/Multisite-Language-Switcher/issues/55

    Please Dennis
    would you tell me exactly where do I have to put the code you provide?
    Hope it works!
    Thanks

    Plugin Author Dennis Ploetner

    (@realloc)

    Just place it in the functions.php of your theme.

    Cheers,
    Dennis.

    It doesn’t work but maybe I am wrong. It works from english to italian but not from the italian site to the english (where “prodotto” should be changed in “product” in the link).

    Here the code, is it right?

    //woocomerce
    remove_action( ‘woocommerce_before_main_content’, ‘woocommerce_output_content_wrapper’, 10);
    remove_action( ‘woocommerce_after_main_content’, ‘woocommerce_output_content_wrapper_end’, 10);
    add_action(‘woocommerce_before_main_content’, ‘my_theme_wrapper_start’, 10);
    add_action(‘woocommerce_after_main_content’, ‘my_theme_wrapper_end’, 10);

    function my_theme_wrapper_start() {
    echo ‘<section id=”main”>’;
    }

    function my_theme_wrapper_end() {
    echo ‘</section>’;
    }
    add_theme_support( ‘woocommerce’ );

    function my_msls_options_get_permalink( $url, $language ) {
    if ( ‘en_US’ == $language ) {
    $url = str_replace( ‘/prodotto/’, ‘/product/’, $url );
    }
    return $url;
    }
    add_filter( ‘msls_options_get_permalink’, ‘my_msls_options_get_permalink’, 10, 2 );
    ?>

    Sorry but I am not a developer 😛 The website is finished and I only miss this to publish it for my client.
    Thanks!

    Plugin Author Dennis Ploetner

    (@realloc)

    I guess – because the URL contains already the word ‘product’ – you need just to modify the link to the Italian site and your function should look like this:

    function my_msls_options_get_permalink( $url, $language ) {
        if ( 'it_IT' == $language ) {
            $url = str_replace( '/product/', '/prodotto/', $url );
        }
        return $url;
    }
    add_filter( 'msls_options_get_permalink', 'my_msls_options_get_permalink', 10, 2 );

    Nothing changes :/
    This is the link in the italian version http://mysite.com/it/prodotto/oblo-ovale-t04/
    and this when I switch to the english one (main site): http://mysite.com/prodotto/oval-porthole-t04/
    In the english version “prodotto” should be replaced by “product”.
    I inserted the code you provided into the function.php file of my theme.
    Suggestion? 🙁

    Plugin Author Dennis Ploetner

    (@realloc)

    What about this one?

    function my_msls_options_get_permalink( $url, $language ) {
        if ( 'it_IT' == $language ) {
            $url = str_replace( '/product/', '/prodotto/', $url );
        }
        elseif ( 'us' == $language ) {
            $url = str_replace( '/prodotto/', '/product/', $url );
        }
        return $url;
    }
    add_filter( 'msls_options_get_permalink', 'my_msls_options_get_permalink', 10, 2 );

    yeeeesss!! It works!
    Many many thanks for this plugin and for you kind and quick support 🙂

    Plugin Author Dennis Ploetner

    (@realloc)

    Very good. Have fun!

    Hi! Here I am again..sorry :/
    Today I realized that the problem was solved only for single products but it remains for categories pages.
    Eg, switching from EN to IT:
    http://mysite.com/products/yacht-category/portholes/ EN
    http://mysite.com/products/categoria-yacht/oblò IT
    In the second link “products” should be replaced by “prodotti”

    Same happens in IT to EN switch:
    http://mysite.com/prodotti/categoria-yacht/oblò IT
    http://mysite.com/prodotti/yacht-category/portholes/ EN
    In the EN version “prodotti” should become “products”

    Maybe I have to add more code somewhere else? allufertempesta.com
    Thank you!

    Plugin Author Dennis Ploetner

    (@realloc)

    Just add 2 lines to the function:

    function my_msls_options_get_permalink( $url, $language ) {
        if ( 'it_IT' == $language ) {
            $url = str_replace( '/product/', '/prodotto/', $url );
            $url = str_replace( '/products/', '/prodotti/', $url );
        }
        elseif ( 'us' == $language ) {
            $url = str_replace( '/prodotto/', '/product/', $url );
            $url = str_replace( '/prodotti/', '/products/', $url );
        }
        return $url;
    }
    add_filter( 'msls_options_get_permalink', 'my_msls_options_get_permalink', 10, 2 );

    Cheers,
    Dennis.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Page Link issue’ is closed to new replies.