• Zen Cart languages Zen Cart & Multiple Languages

    Zen Cart really is quite robust ecommerce software. Setting up your Zen Cart to offer multiple languages is pretty common, if you are just getting started go here. This post is designed to help multiple language Zen Carts correctly direct the search engines to the correct language specific page when appropriate.

    Zen Cart 1.3.9 and newer has the awesome rel="canonical" links in the <head>, so we can use this function to better offer up our multilingual pages!

    Your language links are conveniently appended with their language ID. URLs such as (/index.php?main_page=index&language=es) contain the language parameter to correctly produce the desired language for your site's visitors.

    That's the easy part ... your shoppers can easily use the language switcher to change languages and shop..... But what about Google?

    Using the rel="alternate" hreflang="x" tag will help Google serve the correct language or regional URL when appropriate. Google says:

    Some example scenarios where rel="alternate" hreflang="x" is recommended:

    • You translate only the template of your page, such as the navigation and footer, and keep the main content in a single language. This is common on pages that feature user-generated content, like a forum post.
    • Your pages have broadly similar content within a single language, but the content has small regional variations. For example, you might have English-language content targeted at readers in the US, GB, and Ireland.
    • Your site content is fully translated. For example, you have both German and English versions of each page.

    The cool part is that now with the robust canonical URLs built in to Zen Cart we can easily accomplish this.

    In includes/templates/your_template/common/html_header.php

    Find:

    <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" />
    <?php if (isset($canonicalLink) && $canonicalLink != '') { ?>
    <link rel="canonical" href="<?php echo $canonicalLink; ?>" />

    Then Add the Following for Edited for Your Language Options:

    <link rel="alternate" hreflang="es" href="<?php echo $canonicalLink; ?>&amp;language=es" />

    Before the <?php } ?>

    So the whole statement with 1 language added would look like this:

    <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" />
    <?php if (isset($canonicalLink) && $canonicalLink != '') { ?>
    <link rel="canonical" href="<?php echo $canonicalLink; ?>" />
    <link rel="alternate" hreflang="es" href="<?php echo $canonicalLink; ?>&amp;language=es" />
    <?php } ?>

    Adding additional languages is as simple as repeating the rel="alternate" line edited for your language like this:

    <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" />
    <?php if (isset($canonicalLink) && $canonicalLink != '') { ?>
    <link rel="canonical" href="<?php echo $canonicalLink; ?>" />
    <link rel="alternate" hreflang="es" href="<?php echo $canonicalLink; ?>&amp;language=es" />
    <link rel="alternate" hreflang="ru" href="<?php echo $canonicalLink; ?>&amp;language=ru" />
    <?php } ?>

    There you go... very easy and no core file edits as you should be editing the html_header.php in your template override directory =)

  • ssl zen carts Zen Cart rel=canonical for Your SSL StoreIf you accept credit cards on your Zen Cart website you are required to be PCI compliant. That is just a fact. Given the shortsightedness of the PCI scanning companies and the speed at which the technology must develop, there will always be scan fails.

    I wrote about a PCI fail recently where the Zen Cart contact form was failing PCI scans for not being protected under SSL. Now, the action is under SSL and it's certainly NOT sensitive information, but there is no convincing the scanning companies.

    The simplest solution is to set your whole website to use only SSL. It's a nice caveat that this also helps build shopper trust and make more money! Even Facebook is SSL by default now, so people are becoming more aware of SSL pages. While certainly the general public doesn't understand the whole thing... they think and have been lead to believe that site's need SSL to be safe.

    Once you have set your entire site to SSL by changing both of your configure files to https links you will find the next snag, no more rel="canonical" tags. Zen Cart's canonical pages tags are awesome! They help you with SEO, reducing duplicate content and many other great perks. If only your SSL shop had them??

    Switching to full SSL will turn off your rel="canonical" tags in all of your pages. While this may be a bit short sighted on the part of the Zen Cart Development Team... it's easily fixed! Once you make the switches to all SSL pages you will eliminate SSL/Non-SSL content duplication completely and fixing your canonical tag is necessary for a smooth transition in the search engines indexes.

    How to TurnĀ  ON Canonical Tags for SSL Pages

    Open includes/init_includes/init_canonical.php

    Find:

    /**
    * SSL Pages get no special treatment, since they're not normally indexed
    */
    case ($request_type == 'SSL'):
    $canonicalLink = '';
    break;

    Change it to:

    /**
    * SSL Pages get no special treatment, since they're not normally indexed
    */
    // case ($request_type == 'SSL'):
    // $canonicalLink = '';
    //break;

    Bravo, now your full SSL Zen Cart Shop has the brilliant rel="canonical" tag!

    ** Important note: DO NOT do this unless you are running a FULL SSL catalog. Doing so will result in canonical tags on both SSL and NON-SSL pages, thus duplicate content.

© 2003-2013 PRO-Webs, Inc. Woodbine, GA 31569-2051