Jump to content

[solved] Multishop: One language per multishop


Recommended Posts

Hi guys,

 

I have a fresh 1.5.2 install and would like to have 4 multishops.

3 in english and 1 in italian.

 

Shop1: MAIN SHOP www.mainshop.com (english)

Shop 2: Latops www.laptops.com (english)

Shop 3: iPods www.ipods.com (english)

Shop 4: iPods www.ipods.it (italian)

 

Is there a way to set this up?

 

In the multishop configuration I find NO place to set the language of the shop.

 

Any ideas?

 

Kind regards

Rassy

Edited by El Patron
marked as solved (see edit history)
Link to comment
Share on other sites

in 1.5 it's very easy to set amongst other things the default languge

 

back office->localization->select the mutlstore configuration

 

click the check box for default language

choose the default language

 

and save it

 

Hi elpatron, thanks a lot - this works great!!

 

What I do not like is the "/en" which is now in the URLs.... before (when only having 1 language) the url looked much cleaner.

Is there a way to restrict the language on a shop to "english" - and get rid of the "/en" in the url?

 

Any ideas? Do I have to use a module for this? Or is it a build in feature?

Link to comment
Share on other sites

Hi elpatron, thanks a lot - this works great!!

 

What I do not like is the "/en" which is now in the URLs.... before (when only having 1 language) the url looked much cleaner.

Is there a way to restrict the language on a shop to "english" - and get rid of the "/en" in the url?

 

Any ideas? Do I have to use a module for this? Or is it a build in feature?

 

Hi, you are very welcome.

 

there are plenty of posts on how to remove the 'lang' part of the URL. do a search (using google not prestashop) and you should find what you are looking for.

 

note: be very careful if you are using more than one gTLD (i.e. .com .biz .net .org etc) as you can (will) be penalized for duplicate content.

Edited by elpatron (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Hello El Patron.

 

I have yesterday implemented a multishop Prestashop, one with gTLD (com) & one with ccTLD (gr) and I will probaby add a third ccTLD (de). I wanted for the three shops to have different front office languages.

I want for the .com to have all 3 languages and English as default

For the .gr I want to have Greek & English with Greek as default

For the .de I want to have German & English with German as default

 

Do you think this is possible??

 

If it is impossible and I have to have all three languages on all shops, do you know how I can change the default lang for each of them?

 

What I am doing but with no result is to initially select the second shop from multishop configuration and then

Localization>Languages>Edit (German for example) and disable the extra language that I do not want to appear at mywebsite.gr but that doesnt seem to work.

Any ideas?

Thank you in advance..

Link to comment
Share on other sites

Hello El Patron.

 

I have yesterday implemented a multishop Prestashop, one with gTLD (com) & one with ccTLD (gr) and I will probaby add a third ccTLD (de). I wanted for the three shops to have different front office languages.

I want for the .com to have all 3 languages and English as default

For the .gr I want to have Greek & English with Greek as default

For the .de I want to have German & English with German as default

 

Do you think this is possible??

 

If it is impossible and I have to have all three languages on all shops, do you know how I can change the default lang for each of them?

 

What I am doing but with no result is to initially select the second shop from multishop configuration and then

Localization>Languages>Edit (German for example) and disable the extra language that I do not want to appear at mywebsite.gr but that doesnt seem to work.

Any ideas?

Thank you in advance..

 

Hi, it does not appear to be possible, i.e. only one language in shop.

 

Nor do you really want that because when you run sitemap (assuming it builds link for each language), your ccTLD's and gTLD will have additional links in sitemap and by robot crawls.

 

Most have issue testing language because native ps will detect browse language and if present in native ps use that language or if language already present in cookie use that language.

 

to really test you would need to change your browser language to the default shop language, clear your cookies and then visit the shop.

Link to comment
Share on other sites

Thank you for your reply. There will be no waste of time concerning the 'only one language in shop' matter.

I will try to change the browser lang as suggested to see if at least I can have different default language per url. (greek for .gr, english for .com, german for .de).

Thanks again for your time.

  • Like 1
Link to comment
Share on other sites

Hi, it does not appear to be possible, i.e. only one language in shop.

 

Nor do you really want that because when you run sitemap (assuming it builds link for each language), your ccTLD's and gTLD will have additional links in sitemap and by robot crawls.

 

Most have issue testing language because native ps will detect browse language and if present in native ps use that language or if language already present in cookie use that language.

 

to really test you would need to change your browser language to the default shop language, clear your cookies and then visit the shop.

 

Dear El Patron,

 

I have finally installed German language pack and created a new german shop at my main shop.

However I have two questions that I would like your kind opinion/assistance.

 

1. How can I have different default languages of the shop depending on which tld is used. In other words when the viewers of my shop, located in Germany enter this subshop to see as default language the German?

I have to add that I went to multistore>localization and changed the language & country from greek & Greece to English & UK for testing purposes at the .gr tld subshop. With no effect. Am I missing something?

Consider this issue as solved. When changed my IP to a UK IP things worked as configured at multistore>localization section.

 

2.Is it possible for products (or category pf products) that are somewhat bulky and have very expensive export transportation costs not to be shown at one of the multishop tld's but to be shown to others?

 

Kind regards,

Edited by mono1 (see edit history)
Link to comment
Share on other sites

Dear El Patron,

 

I have finally installed German language pack and created a new german shop at my main shop.

However I have two questions that I would like your kind opinion/assistance.

 

1. How can I have different default languages of the shop depending on which tld is used. In other words when the viewers of my shop, located in Germany enter this subshop to see as default language the German?

I have to add that I went to multistore>localization and changed the language & country from greek & Greece to English & UK for testing purposes at the .gr tld subshop. With no effect. Am I missing something?

Consider this issue as solved. When changed my IP to a UK IP things worked as configured at multistore>localization section.

 

2.Is it possible for products (or category pf products) that are somewhat bulky and have very expensive export transportation costs not to be shown at one of the multishop tld's but to be shown to others?

 

Kind regards,

 

gosh, I am still running my 1.4 multishop, 1.5+ has loads of cool fancy multishop features, someday I upgrade. :)

 

so, because we share products/categories across shops can we then go back and 'unshare' some things?

 

good question!  did you try to work in categories with selected shop, disable from view?  I don't know if this is possible, if not then I suspect you are going to need some custom code.

 

also it is a good idea to post new topic as this may have been addressed by other community member.

Link to comment
Share on other sites

gosh, I am still running my 1.4 multishop, 1.5+ has loads of cool fancy multishop features, someday I upgrade. :)

 

so, because we share products/categories across shops can we then go back and 'unshare' some things?

 

good question!  did you try to work in categories with selected shop, disable from view?  I don't know if this is possible, if not then I suspect you are going to need some custom code.

 

also it is a good idea to post new topic as this may have been addressed by other community member.

 

At least as far as I could go when disabling a category  inherited from main shop, while controlling sub-shop from the backoffice, this alteration had effect at main shop and at all shops generally.

 

So as far as it concerns my situation since I have not spend yet any working hours on this subshop it will be better to delete it and when re-installing it to select carefully which categories I do and which I dont to appear at new subshop.

 

Just for the educational part of this topic (maybe it would be helpful for other people that might read this topic) I have to mention that on the other hand when you create a NEW category at SUB SHOP level, this new category appears at this shop and ONLY. So if you consider the fact (?) that  you can't delete an inherited category from one shop only, its better not to import questionable (if its good idea to import or not) categories. You can always add them later as new categories, specifically for the shop under question.

 

Kind regards and thank you for your time once again.

Edited by mono1 (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 8 months later...
  • 8 months later...

i tried to modify it,  in  /override/classes/Language.php (override /classes/Language.php)

 

add a new function to judge is current langue activated for this shop,

public static function isLanguageActivatedForThisShop($id_shop = null,$id_lang = null)
    {
         if (isset(Context::getContext()->shop) && is_object(Context::getContext()->shop) && $id_shop === null) {
            $id_shop = (int)Context::getContext()->shop->id;
        }

         
             $ActiveLanguages = Db::getInstance()->getValue('
				SELECT COUNT(*) FROM `'._DB_PREFIX_.'lang` l
				JOIN '._DB_PREFIX_.'lang_shop lang_shop ON (lang_shop.id_lang = l.id_lang AND lang_shop.id_shop = '.(int)$id_shop.')
				WHERE l.`active` = 1 and l.`id_lang` = '.(int)$id_lang
			);
         
        return ($ActiveLanguages>0 );
    }

then,

modify   /override/classes/Tools.php

if (Validate::isLoadedObject($language) && $language->active) {
                $context->language = $language;
            }

to 

if (Language::isLanguageActivatedForThisShop($context->shop->id,$id_lang) && Validate::isLoadedObject($language) && $language->active) {
                $context->language = $language;
            }

it seems work ok now

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...