Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2019
    Location
    montreal, canada
    Posts
    6
    Plugin Contributions
    0

    Default Multi-Language - "Home" button LINK alyways go back to default language

    I upgraded my TEST website from 1.39H to 1.55f, everything works fine after few adjustments. This website is configure to support English and French language, the default language is "English".

    I have a issue about the "Home / Accueil" button, the URL don't take care of language setting, it always go back to default language in "English". No issue in 1.39H.


    Name:  zencart155.jpg
Views: 245
Size:  79.5 KB


    TEST WEBSITE URL : www.pechesudv155.owally.com

    Version of Zen Cart: 1.55F
    PHP version: 5.6.39 (phpinfo.php is avalaible)
    SSL: Yes

    Plugin: French Language pack made from "English version"


    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++
    I suppose the home button link is define inside TLP_HEADER.PHP
    Line: 47 <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++

    My question is: How language code is set inside "home" button URL ? or Does someone else already had the same issue? how can I fix this ?

    Thanks for your help
    Pierre

  2. #2
    Join Date
    Jan 2019
    Location
    montreal, canada
    Posts
    6
    Plugin Contributions
    0

    Default Re: Multi-Language - "Home" button LINK alyways go back to default language

    I remark the "home" button link doesn't contains the last language selection made per the user, so when the browser display the main page, it use your browser default language.
    Maybe it's better like this. But in 1.39H version, the URL contains the last language selection made per the user.

  3. #3
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,684
    Plugin Contributions
    9

    Default Re: Multi-Language - "Home" button LINK alyways go back to default language

    Quote Originally Posted by pechesud View Post
    I remark the "home" button link doesn't contains the last language selection made per the user, so when the browser display the main page, it use your browser default language.
    Maybe it's better like this. But in 1.39H version, the URL contains the last language selection made per the user.
    the problem is with your sessions. you are losing the session when pressing the home button.

    not sure if you are on a different version of php; and i'm not a sessions expert. but if you add the previous session id to the home url you will still have the language selection.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  4. #4
    Join Date
    Jan 2019
    Location
    montreal, canada
    Posts
    6
    Plugin Contributions
    0

    Default Re: Multi-Language - "Home" button LINK alyways go back to default language

    Quote Originally Posted by carlwhat View Post
    the problem is with your sessions. you are losing the session when pressing the home button.

    not sure if you are on a different version of php; and i'm not a sessions expert. but if you add the previous session id to the home url you will still have the language selection.
    I think, it's linked to my provider environment, I made a test on my PC with XAMPP, with the same PHP version, same code and database, everything works perfectly. Now, I need to find out how I can lose the SESSION ID on Linux?

  5. #5
    Join Date
    Jan 2019
    Location
    montreal, canada
    Posts
    6
    Plugin Contributions
    0

    Default Re: Multi-Language - "Home" button LINK alyways go back to default language

    Quote Originally Posted by pechesud View Post
    I think, it's linked to my provider environment, I made a test on my PC with XAMPP, with the same PHP version, same code and database, everything works perfectly. Now, I need to find out how I can lose the SESSION ID on Linux?
    I also noticed that when browsing through the catalog and overing the links, we see the URL defined at the bottom of the screen with the Zenid = xxxx, but if we pass the mouse over the "home" button, we do not see the Zenid only the website URL. Does someone know in which PHP program is defined?

  6. #6
    Join Date
    Jan 2019
    Location
    montreal, canada
    Posts
    6
    Plugin Contributions
    0

    Default Re: Multi-Language - "Home" button LINK alyways go back to default language

    Quote Originally Posted by pechesud View Post
    I also noticed that when browsing through the catalog and overing the links, we see the URL defined at the bottom of the screen with the Zenid = xxxx, but if we pass the mouse over the "home" button, we do not see the Zenid only the website URL. Does someone know in which PHP program is defined?
    In between, I made a PATCH inside this PHP code:

    \includes\templates\pechesud\common\Tlp_header.php and tlp_footer.php

    <div id="navMainWrapper">
    <div id="navMain">
    <ul class="back">
    <li><?php
    //------------------------------------------------------------------------------------------------------
    // If session language is French, set value to french language, otherwise english
    // ------------------------------------------------------------------------------------------------------
    if ($_SESSION['language']=='french') {
    echo '<a href="' . HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . 'index.php?main_page=index&language=fr">'; }
    else
    { echo '<a href="' . HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . 'index.php?main_page=index&language=en">'; }
    //------------------------------------------------------------------------------------
    ?>

    <?php echo HEADER_TITLE_CATALOG;


    \includes\classes\breadcrumbs.php

    if (isset($this->_trail[$i]['link']) && zen_not_null($this->_trail[$i]['link']) && !$skip_link ) {
    // this line simply sets the "Home" link to be the domain/url, not main_page=index?blahblah:
    if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
    //------------------------------------------------------------------------------------------------------
    // If session language is french
    //------------------------------------------------------------------------------------------------------
    if ($_SESSION['language']=='french') {
    $trail_string .= ' <a href="' . HTTP_SERVER . DIR_WS_CATALOG . 'index.php?main_page=index&language=fr">' . $this->_trail[$i]['title'] . '</a>';}
    else
    {$trail_string .= ' <a href="' . HTTP_SERVER . DIR_WS_CATALOG . 'index.php?main_page=index&language=en">' . $this->_trail[$i]['title'] . '</a>';}
    //--------------------------------------------------------------------------------------------------------
    } else

  7. #7
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Multi-Language - "Home" button LINK alyways go back to default language

    In your cases of checking what language is being used, unless you have some reason to redirect one language that is installed to your system to another, you can simplify this and also ensure that it doesn't matter what language is installed:
    Code:
    HTTP_SERVER . DIR_WS_CATALOG . 'index.php?main_page=index&language=' . $_SESSION['languages_code']
    Note I used a single quote at the end of the equals sign, but you may need to use a double quote depending on what was used to open that text.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    Jan 2014
    Location
    Ontario, Canada
    Posts
    252
    Plugin Contributions
    3

    Default Re: Multi-Language - "Home" button LINK alyways go back to default language

    Quote Originally Posted by pechesud View Post
    I also noticed that when browsing through the catalog and overing the links, we see the URL defined at the bottom of the screen with the Zenid = xxxx, but if we pass the mouse over the "home" button, we do not see the Zenid only the website URL. Does someone know in which PHP program is defined?
    Hi Pechesud,
    You are correct in mentioning that you will not see a zenid only the website url.

    Double check that you have copied all the new language files where the default language files are. Also, make sure you have the current template files copied into the new language files.

    This is where I had issues in the past.

  9. #9
    Join Date
    Jan 2019
    Location
    montreal, canada
    Posts
    6
    Plugin Contributions
    0

    Default Re: Multi-Language - "Home" button LINK alyways go back to default language

    Quote Originally Posted by mc12345678 View Post
    In your cases of checking what language is being used, unless you have some reason to redirect one language that is installed to your system to another, you can simplify this and also ensure that it doesn't matter what language is installed:
    Code:
    HTTP_SERVER . DIR_WS_CATALOG . 'index.php?main_page=index&language=' . $_SESSION['languages_code']
    Note I used a single quote at the end of the equals sign, but you may need to use a double quote depending on what was used to open that text.
    Thanks everybody. But I resolved my issue, simply changing HTTP_SERVER definition inside includes/configure.php, I forced "https://" prefix even it's supposed to be a "http://"

    define('HTTP_SERVER', 'https://www.pechesudv155.owally.com');
    define('HTTPS_SERVER', 'https://www.pechesudv155.owally.com');

    Browsing product list "source code" inside FireFox, I remarked some links begun per "https:" and some per "http:" creating some strange results.

    Maybe it's also caused my hosting company who added some code inside my .htacces forcing "https://" usage everywhere, so I each time I click on a link with "http", a new session is created.

    .htaccess
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*)$ [NC]
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule (.*) https://%1%{REQUEST_URI} [L,R=301]



 

 

Similar Threads

  1. v151 How to link "Back to Product List" button back to last page history
    By sports guy in forum General Questions
    Replies: 3
    Last Post: 28 Feb 2015, 11:11 AM
  2. "Multi-Language Support for EZ-Pages" prints "Array" in Sidebox
    By andreas.hennig in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 13 Jul 2010, 08:23 AM
  3. Language reverts back to default language
    By shocker in forum Addon Language Packs
    Replies: 1
    Last Post: 27 Oct 2008, 06:36 AM
  4. multi language button image in header, links to multi language pages
    By bluesky2008 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 31 Jul 2008, 04:14 PM
  5. How to set a default country per language for multi language sites
    By lacabessa in forum Addon Language Packs
    Replies: 2
    Last Post: 18 Nov 2006, 11:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR