Post by Maria-S » Tue May 19, 2015 4:26 pm

Hello everyone,

I have a multistore (Version 1.5.6) with 3 stores:
eshop.example.gr
eshop.example.com.cy
eshop2.example-new.com

The 1st and the 2nd stores have greek as their default language and english as a second language.

For the 3rd store I have set up english as the default language. The problem is that it also has greek as a second language! I dont want that. I need the 3th store to be only in English.

Is that possible? Can anyone help me on how to do that??? Please help me :(

Thanks in advance

User avatar
Newbie

Posts

Joined
Sun Jun 15, 2014 10:59 pm

Post by fido-x » Wed May 20, 2015 5:52 pm

Try this: In the header template file (catalog/view/theme/default/template/common/header.tpl), find (at line 57):

Code: Select all

<?php echo $language; ?>
and wrap it with an "if" statement, as follows:

Code: Select all

<?php if ($this->config->get['config_store_id') != 3) { ?>
<?php echo $language; ?>
<?php } ?>
If the store_id of your 3rd store is not "3", then replace with the correct store_id. If you're not using the default theme, make the change in your custom theme's header template file.

I haven't tested this, but it should remove the option for the customer to select the language and only display in the default language for that store.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Maria-S » Thu May 21, 2015 4:46 pm

@fido-x: Thank you very much for your reply.

I don't use the default theme, so in my custom theme header template file I have this:

Code: Select all

<?php echo $language.$currency; ?>
Unfortunatelly I am not familiar with php so I just did exactly what you said (the store_id of the 3rd store is "2"):

Code: Select all

<?php if ($this->config->get['config_store_id') != 2) { ?>
                                        <?php echo $language.$currency; ?>
                                        <?php } ?>
As a result the whole multistore does not work. I believe that is happening because next to "$language" there is "$currency;". What is your opinion? Do you have anything further to suggest?

Thank you so much for your time :)

User avatar
Newbie

Posts

Joined
Sun Jun 15, 2014 10:59 pm

Post by fido-x » Thu May 21, 2015 7:36 pm

Not a good practice to combine the two into a single PHP statement in my opinion. Not your fault.

Wrapping both the language and currency in the "if" statement would also remove the currency selection for that store - not good.

Try this instead. Replace:

Code: Select all

<?php echo $language, $currency; ?>
with:

Code: Select all

<?php if ($this->config->get['config_store_id') != 2) { ?>
<?php echo $language; ?>
<?php } ?>
<?php echo $currency; ?>
This should work. I tested it on a multi-store setup on my local server and it worked there.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Maria-S » Thu May 21, 2015 8:14 pm

@fido-x: Thanks for your quick reply.

I did what you said and.. nothing :( I get a message in dreamweaver, above the code of the header.tpl that says:
There is a syntax error in line 415. Code hinting may not work until you fix this error.
Do you think that this is the reason why your suggestion does not work?

Line 415:

Code: Select all

var responsive_design = '<?php if($theme_options->get( 'responsive_design' ) == '0')
I know this is not your problem but if you had time to help me I would really apreciate it.

Thanks in advance

User avatar
Newbie

Posts

Joined
Sun Jun 15, 2014 10:59 pm

Post by fido-x » Fri May 22, 2015 6:54 pm

OK, try this one. Replace:

Code: Select all

<?php echo $language, $currency; ?>
with:

Code: Select all

<?php if ($this->config->get('config_store_id') == 2) { ?>
<?php echo $currency; ?>
<?php } else { ?>
<?php echo $language, $currency; ?>
<?php } ?>
Again, this has been tested and it works, at least with the default theme. If it doesn't work with your custom theme, I would suggest contacting the developer of that theme to find out why, as there is obviously a problem with it.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Maria-S » Fri May 22, 2015 8:25 pm

@fido-x: Hello,

Thanks for your help.

Yes!After a few tests, based on your code, the solution is:

Code: Select all

<?php if ($this->config->get('config_store_id') == 2) { echo $currency; } else { echo $language.$currency; } ?>
Thanks for your time!
Have a nice day!

Regards,
Maria

User avatar
Newbie

Posts

Joined
Sun Jun 15, 2014 10:59 pm

Post by slebote » Mon Apr 04, 2016 12:48 am

Hello there,

I recently tortured myself on this subject to find a proper solution to handle enabled languages on each Opencart stores and I finally implemented a VQMOD module to handle the full process.

As you said before you have the simple solution of proposing some languages you want but you might be surprised with Opencart cookies : you might face the issue of having an unwanted language on a store who does not propose it due to language detection and some other functionnalities.

I recently released a module that allows you to handle it from the backoffice if you are interested in.
Here is the plugin link : http://www.opencart.com/index.php?route ... n_id=26264

I guarantee the compatibility from the version 1.5.4 as I spent most of my time testing it on every possible versions and I will probably continue if some people are interested in.

Here is a quick screenshot:

Image

Regards,
slebote

Newbie

Posts

Joined
Thu Mar 24, 2016 6:26 am
Who is online

Users browsing this forum: No registered users and 12 guests