Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15
  1. #11
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Implementing hreflang in a multilanguage store

    After reading a number of sources, it seems best to skip if only 1 language, or display for all languages if more than 1.

    So, proposing this: https://github.com/zencart/zencart/pull/1314
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  2. #12
    Join Date
    Jul 2009
    Posts
    402
    Plugin Contributions
    0

    Default Re: Implementing hreflang in a multilanguage store

    Quote Originally Posted by DrByte View Post
    After reading a number of sources, it seems best to skip if only 1 language, or display for all languages if more than 1.

    So, proposing this: https://github.com/zencart/zencart/pull/1314
    Hi,
    I have implemented the mod proposed so the html_header section becomes

    PHP Code:
    // BOF hreflang for multilingual sites

    if (isset($language_list) || $language_list $lng->get_available_languages() && sizeof($language_list) > 1) {
         foreach(
    $language_list as $key=>$value) {
    echo 
    '    <link rel="alternate" href="' . ($this_is_home_page zen_href_link(FILENAME_DEFAULT'language=' $value['code'], $request_type) : $canonicalLink . (strpos($canonicalLink'?') ? '&amp;' '?') . 'language=' $value['code']) . '" hreflang="' $value['code'] . '" />' "\n";
         }
       }
       
    // EOF hreflang for multilingual sites 
    But I get a blank page and the following error log


    PHP Fatal error: Call to a member function get_available_languages() on a non-object in /home2/xxxxx/public_html/includes/templates/responsive_classic/common/html_header.php on line 71

    I have noticed that in github the file lines to modified start with 48 while in my file the lines were
    PHP Code:
    // BOF hreflang for multilingual sites 
    is starts at 73.

    I would like to understand this.
    Thanks.

    Happy New Year from Italy

    enzo
    Last edited by enzo-ita; 1 Jan 2017 at 07:55 PM.

  3. #13
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Implementing hreflang in a multilanguage store

    Quote Originally Posted by enzo-ita View Post
    PHP Fatal error: Call to a member function get_available_languages() on a non-object in /home2/xxxxx/public_html/includes/templates/responsive_classic/common/html_header.php on line 71

    I have noticed that in github the file lines to modified start with 48 while in my file the lines were
    PHP Code:
    // BOF hreflang for multilingual sites 
    is starts at 73.

    I would like to understand this.
    That's because the change posted is for v1.6.0.

    For your v1.5 site, do what torvista posted above to get it to output the tags for all languages. And since you're supporting multiple languages already you won't need the other part of the change I mentioned in v160.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #14
    Join Date
    Jul 2009
    Posts
    402
    Plugin Contributions
    0

    Default Re: Implementing hreflang in a multilanguage store

    Quote Originally Posted by DrByte View Post
    That's because the change posted is for v1.6.0.

    For your v1.5 site, do what torvista posted above to get it to output the tags for all languages. And since you're supporting multiple languages already you won't need the other part of the change I mentioned in v160.
    Thanks. I di it and it works. For my other site that is mono language I do not need to touch the html_header.php right?
    Ciao ciao

  5. #15
    Join Date
    Apr 2017
    Location
    Netherlands
    Posts
    20
    Plugin Contributions
    0

    Default Re: Implementing hreflang in a multilanguage store

    Is the code in html_header already corrected in 1.55e (I copied the code from zen-cart 1.55e) or should I still apply the fix described in this forum ( I have 3 languages installed)?

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v154 Multilanguage search
    By istilah in forum General Questions
    Replies: 1
    Last Post: 6 Apr 2017, 10:44 AM
  2. v151 Multilanguage store not displaying
    By vitaevalue in forum Addon Language Packs
    Replies: 2
    Last Post: 30 Oct 2013, 06:57 PM
  3. Multilanguage EZ-Pages
    By sumri in forum General Questions
    Replies: 0
    Last Post: 25 Sep 2008, 06:53 AM

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