No problem and sorry for little delay.
Here is the full code of a side module template (.tpl file for a module that displays on left or right side of the webstore).
What you actually need from here for the purpose of checking if the customer is loged in or not, is few lines in the middle:
1. - this line checks if the visitor is loged in or not
2. - this is example message to be shown to not registered visitors and nothing more.
3. - is the else code, i.e. if the visitor is logged in, that the rest of the code is valid.
4. - this is that, so called, the rest of the code, this line is by default in all side modules.
5. - DO NOT FORGET to put this new line afterwards.
And that would be all, except that you would have to put a new line in the coresponding controller file.
For example, if the module that you are playing with has the name of samplemodule, the above codes should be changed in the catalog/view/theme/default/template/module/samplemodule.tpl (default is the name of your template, check if the path is correct. So, that is the template file, i.e. it is how it would look to the visitor.
The line we have to put in the controller file is next:
and the file where to put this line would be: catalog/controller/module/samplemodule.php
AND THAT IS ALL.
hope it would help someone.
anyway, here is another interesting similar topic:
http://forum.opencart.com/viewtopic.php ... 3E#p142346
Here is the full code of a side module template (.tpl file for a module that displays on left or right side of the webstore).
Code: Select all
<div class="box">
<div class="top">
<?php
if($title) { ?>
<img src="catalog/view/theme/default/image/brands.png" alt="" /><?php echo $title; ?>
<?php
} ?>
</div>
<div class="middle" style="text-align: left;"><div id="category">
<?php if (!$logged) { ?>
<strong><font color="#FF0000">Here goes some text to be shown to the unregistered visitors.</strong></font>
<?php } else { ?>
<?php echo $code; ?>
<?php } ?>
</div>
</div>
<div class="bottom"> </div>
</div>
1.
Code: Select all
<?php if (!$logged) { ?>
2.
Code: Select all
<strong><font color="#FF0000">Here goes some text to be shown to the unregistered visitors.</strong></font>
3.
Code: Select all
<?php } else { ?>
4.
Code: Select all
<?php echo $code; ?>
5.
Code: Select all
<?php } ?>
And that would be all, except that you would have to put a new line in the coresponding controller file.
For example, if the module that you are playing with has the name of samplemodule, the above codes should be changed in the catalog/view/theme/default/template/module/samplemodule.tpl (default is the name of your template, check if the path is correct. So, that is the template file, i.e. it is how it would look to the visitor.
The line we have to put in the controller file is next:
Code: Select all
$this->data['logged'] = $this->customer->isLogged();
AND THAT IS ALL.
hope it would help someone.
anyway, here is another interesting similar topic:
http://forum.opencart.com/viewtopic.php ... 3E#p142346
Hi, This is my first bit of give-back-some-help to the forum as I have found it so helpful to me. I have very little experience with web developing apart from a few evening classes so you will have to excuse my amature approach in explaining this. I have got multi store to work fine for me on my three stores inculding modules across all stores using sub domains. I'm using Version 1.5.1.3. I'll try to explain how I did this as best I can in three steps as follows:
1. In your backend admin panel go to system, settings & create a store named for exampel ' store2 '. Important to use the full url http://www.store2.yourdomain.com/ and very important to use the ' / ' at the end. Enter all your details.
2. Login to the cp (cpanel or Control Panel) of your domain usually ' cp.yourdomain.com ' or ' cpanel.yourdomain.com '. Navigate to the subdomain area and enter. Now enter the subdomain name as choosen earlier for your shop ' store2 ' and click create. The document root should now be called something like ' public_html/store2 '. Rename this to public_html so this now points to the same folder as your already uploaded opencart site (yourdomain.com).
3. In your backend admin panel go to system, design, layouts. Basically you need to copy each layout name and rename the new one with a distinguishing remark e.g. ' Home ' is the original and the copy is ' Home 2 '. You will need to keep the ' Route ' the same so what i did, just to be safe was e.g. first edit ' Home ' and copy the ' Route ' (common/home) ' then cancel out of it, click insert and the first thing i did after that was click ' Add Route ' and paste ' (common/home) '. Then I added the title ' Home 2 ' and I selected my new subdomain store from the drop down menu.
*** Thats it, all should work now ***
To test do thes steps; go to your backend admin panel, extensions, moduels and say for e.g. you want to add the category moduel to your home page on your main domain ' http://www.yourdomain.com ' on the left hand side of the page, click category, ' Add Module ' and from the layout dropdown menu select ' Home ' and select the ' Column Left ' position. The category module will not appear in your new store ' http://www.store2.yourdomain.com ' until you repeat these steps but you may wish to have the category module on the right hand side of the page instead etc. etc. There is probably a simpler way to do it but when you dont know, you just dont know.
1. In your backend admin panel go to system, settings & create a store named for exampel ' store2 '. Important to use the full url http://www.store2.yourdomain.com/ and very important to use the ' / ' at the end. Enter all your details.
2. Login to the cp (cpanel or Control Panel) of your domain usually ' cp.yourdomain.com ' or ' cpanel.yourdomain.com '. Navigate to the subdomain area and enter. Now enter the subdomain name as choosen earlier for your shop ' store2 ' and click create. The document root should now be called something like ' public_html/store2 '. Rename this to public_html so this now points to the same folder as your already uploaded opencart site (yourdomain.com).
3. In your backend admin panel go to system, design, layouts. Basically you need to copy each layout name and rename the new one with a distinguishing remark e.g. ' Home ' is the original and the copy is ' Home 2 '. You will need to keep the ' Route ' the same so what i did, just to be safe was e.g. first edit ' Home ' and copy the ' Route ' (common/home) ' then cancel out of it, click insert and the first thing i did after that was click ' Add Route ' and paste ' (common/home) '. Then I added the title ' Home 2 ' and I selected my new subdomain store from the drop down menu.
*** Thats it, all should work now ***

To test do thes steps; go to your backend admin panel, extensions, moduels and say for e.g. you want to add the category moduel to your home page on your main domain ' http://www.yourdomain.com ' on the left hand side of the page, click category, ' Add Module ' and from the layout dropdown menu select ' Home ' and select the ' Column Left ' position. The category module will not appear in your new store ' http://www.store2.yourdomain.com ' until you repeat these steps but you may wish to have the category module on the right hand side of the page instead etc. etc. There is probably a simpler way to do it but when you dont know, you just dont know.

Thanks for the help! Very useful post!
This account is inactive. Look for us under the name 'EvolveWebHosting' and contact us under that username.
Thanks!
I'd like to clarify a bit about this post originally being for "1.4.x".. you could NOT keep modules separate between stores
However, in 1.5.x you CAN keep modules separate.
1. Create Layouts in System->Design->Layouts
2. You should have existing ones like "default" "checkout" "home" etc.
If you edit these you can see there is a "store" selector.
Create separate layouts for your second store and make sure the routes only apply to store 2. Then add modules assigned to this store2 layout. Now you can have modules on store 2 different from store 1.
However, in 1.5.x you CAN keep modules separate.
1. Create Layouts in System->Design->Layouts
2. You should have existing ones like "default" "checkout" "home" etc.
If you edit these you can see there is a "store" selector.
Create separate layouts for your second store and make sure the routes only apply to store 2. Then add modules assigned to this store2 layout. Now you can have modules on store 2 different from store 1.
Thanks for the clarifications!Qphoria wrote:I'd like to clarify a bit about this post originally being for "1.4.x".. you could NOT keep modules separate between stores
However, in 1.5.x you CAN keep modules separate.
1. Create Layouts in System->Design->Layouts
2. You should have existing ones like "default" "checkout" "home" etc.
If you edit these you can see there is a "store" selector.
Create separate layouts for your second store and make sure the routes only apply to store 2. Then add modules assigned to this store2 layout. Now you can have modules on store 2 different from store 1.
This account is inactive. Look for us under the name 'EvolveWebHosting' and contact us under that username.
Thanks!
For some strange reason, I can't get any modules to show up on the product pages of my 2nd store, despite having defined all the 'Routes' for my 2nd store in admin > system > design > layouts. Everything works perfectly on my default, and all the modules are showing fine on all the other pages in my 2nd store, just not product pages. I am running 1.5.3.1
Any ideas? This is really starting to drive me nuts.
Any ideas? This is really starting to drive me nuts.
Ok, so i found this thread and info is great... but how do we customize the product selection in the Featured module for each individual multi-store -- so that each store has a different product selection??
More info: We have several multi-stores. All stores have the same product mix but each individual store "manager" needs the ability to choose their specific featured products from that mix and each store needs to be independent from others in this way.
Is there any way to do this?
Thanks in advance for the help!
More info: We have several multi-stores. All stores have the same product mix but each individual store "manager" needs the ability to choose their specific featured products from that mix and each store needs to be independent from others in this way.
Is there any way to do this?
Thanks in advance for the help!
Hi, I could see you can select a different layout, but the module configuration will still the same.cwswebdesign wrote:Thanks for the clarifications!Qphoria wrote:I'd like to clarify a bit about this post originally being for "1.4.x".. you could NOT keep modules separate between stores
However, in 1.5.x you CAN keep modules separate.
1. Create Layouts in System->Design->Layouts
2. You should have existing ones like "default" "checkout" "home" etc.
If you edit these you can see there is a "store" selector.
Create separate layouts for your second store and make sure the routes only apply to store 2. Then add modules assigned to this store2 layout. Now you can have modules on store 2 different from store 1.
So, what could be done in a case we need to use a module that uses API like YotPo (a review module).
Suppose you have a multi-language website and want to install YotPo. YotPo can only handle one single language. So in a multi-language store the reviews will be on the same for both languages to the one defined on admin panel. It would be interesting if the module could have different configurations based on each store.
Something like store one, module configuration 1, store two, module configuration 2 and so forth.
Is it possible to do it?
Thanks.
Who is online
Users browsing this forum: No registered users and 2 guests