Fix for Single Location Stores

Just thought I would post this up in case any of you are unaware, or know there is a problem but not sure how to fix it.



If you run a store in one single language aimed at a particular geo-location you should be aware of this problem, which in my case -UK English for the UK market - is most definitely an issue.



As default, CS-Cart sets the language code to “en” which is generally fine for Google as they use more advanced methods of geotargetting, but the likes of Bing and Yahoo (Bing, with a different logo), they're not so advanced and so, your geotargeting is made more difficult. Note you can also tell Google directly which location to target via Google Webmaster Tools.



Take this example:



One of my stores can only ship products within the UK due to the size/weight limitations, costs outside the UK would be astronomical in comparison to the products price.



This store has all of the keywords which I selected ranking in the top 10 of Google.co.uk, but nowhere to be seen using Bing UK search or Yahoo.co.uk. These are fairly important revenue streams, given ISP's use their systems to power their search engines.



However, using Bing US and Yahoo US, the keywords all rank in the top 5. The respective UK searches see the store ranking somewhere into oblivion for these same keywords. So a little investigation was required…



Why? Bing specifically uses the language code to set the geo-location if other factors cannot be determined. This store uses a non-localised TLD (top level domain, ie. .org, .net, etc). The server is located in the UK and used UK-English throughout the store.



So what should you do? First off, stop reading and bang your head against a wall if you target more than one language and location. Sounds harsh, but as yet I haven't found (nor needed to find) a solution for stores targetting more than one language.



There's a few 3rd party addons which use the index.override.tpl and/or meta.override.tpl, so there is no “fix” for all stores, it largely depends on what addons you've used and what my_changes hooks you have created.



Basically, if an index.override.tpl or meta.override.tpl is used in your templates, you should add the code to those files. Templates are controlled via priority and one meta.override.tpl will override another meta.override.tpl - there should only be one instance of 'XYZ.override.tpl' in use.



Ok, so this is how I've fixed it. If your store is UK English, I advise you use the following:



Administration > Languages



Add Language Variable



Language Variable: language_code_gb

Value: -gb



This therefore makes the following language variable available in your templates, like so:

{$lang.language_code_gb}



You should now apply this code to the relevent places in your templates only if your store is targetted to one single language country, in my case, GB (Great Britain/UK).



In index.tpl (or index.override.tpl if it exists, if not, you should do this via the my_changes method):



Find:




Replace with:






In meta.tpl (or meta.override.tpl if it exists, if not, again, you should do this via my_changes):



Find





Replace with:







Note, you can simply change “gb” to whichever geolocation language you require.



This should render the following in your source code:

```php


```
```php ```

You should also set the location in Google Webmaster Tools, which if you don't already have an account, you should definitely sign up. CS-Cart have confirmed they will likely publish a fix for this issue shortly.

Thanks for this one. Done the changes, and it seems to work as you describe.



I still have one place in my source-code where it says EN, and i would like NO. Anyone know what “var default_language” means, and where to edit that code?



var default_editor = 'tinymce';
var default_previewer = 'fancybox';
var cart_language = 'NO';
var default_language = 'EN';
var images_dir = '/skins/basic/customer/images';
var skin_name = 'basic';

If your store is in Nord (?), you won't have a problem because in CS-Cart>Languages, the Language Code should be 'no', thus, generating the perfectly adequate:



The problem is really exists for the following:



EN-GB (English-Great Britain)

EN-US (English-United States)

ES-ES (Spanish-Spain)

FR-CA (French-Quebec)

FR-FR (French-France)



The default language is set in config.php.

Norway :grin:

[quote name=‘Onkel_Sid’ timestamp=‘1361915140’ post=‘156457’]

Norway :grin:

[/quote]

My bad. Norsk then :? You shouldn’t have a problem then. Only sites geo-targetting exclusively the US, UK, Spain, French Quebec and France should take heed of this warning.