Post by gerigo » Sat Mar 12, 2011 8:33 am

I have a store running with two store fronts (http://www.alpen-markt.at).
Now i want to choose if a module shows up or not.
(for example the newsletter module should show up in store1 but NOT in store2)

Ist there any solutions how to do that without core hacking?
Last edited by gerigo on Sun Mar 13, 2011 10:21 am, edited 1 time in total.

Newbie

Posts

Joined
Sat Mar 12, 2011 8:19 am

Post by Xsecrets » Sat Mar 12, 2011 2:25 pm

no

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by gerigo » Sun Mar 13, 2011 12:26 am

Xsecrets wrote:no
"no" is a nogo - This is a essential function for a multishop.
I'm sure there is a ready solution out there, the question is if anybody who did this wants to give this back to the community!!!

Newbie

Posts

Joined
Sat Mar 12, 2011 8:19 am

Post by gerigo » Sun Mar 13, 2011 2:44 am

So I found out the almost too easy solution!!!
Just copy and paste the original module .tpl files in your template/modules directories, change and relax!!!

Quick and easy!

Newbie

Posts

Joined
Sat Mar 12, 2011 8:19 am

Post by Ljubo » Thu Apr 14, 2011 8:24 pm

sorry for being ignorant, but could you explain it a little bit more in details?

this would be very useful for me.

thanks!

Active Member

Posts

Joined
Mon Jan 31, 2011 10:07 pm
Location - Serbia

Post by Xsecrets » Thu Apr 14, 2011 8:53 pm

well that might solve your position problems, but it's not going to give you different settings per store.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by gerigo » Thu Apr 14, 2011 8:59 pm

No problem, I just don't know how to start... and what you are supposing to do.
I used this for creating http://www.kite4ever.com/index.php? which is the main store and http://mutinykites.at/?shop which is only a new store front.
So if you have two different templates for different store fronts it works like this.
In every template you can make module overrides by simply copying the original module template files to catalog/view/theme/YOURTHEME1/template/Module/yourmodule.tpl (yourmodule.tpl can be one of the sidebar modules like newsletter, cart, information, eg.)
In theese files you can style or modify the modules, or simply uncomment or delete the code for not showing up the module in this template.

Hope this helped
Last edited by gerigo on Thu Apr 14, 2011 9:01 pm, edited 1 time in total.

Newbie

Posts

Joined
Sat Mar 12, 2011 8:19 am

Post by Ljubo » Thu Apr 14, 2011 9:01 pm

it is not the place to ask, but a quick reply needed...
customers in multistore feature of opencart;
registered customer of one store is allowed to login to other store of multistore feature as well?
although he is actually not registered at that second one?

edit> thanks for quick reply to previous question.

Active Member

Posts

Joined
Mon Jan 31, 2011 10:07 pm
Location - Serbia

Post by Xsecrets » Thu Apr 14, 2011 9:10 pm

Ljubo wrote:it is not the place to ask, but a quick reply needed...
customers in multistore feature of opencart;
registered customer of one store is allowed to login to other store of multistore feature as well?
although he is actually not registered at that second one?

edit> thanks for quick reply to previous question.
quick reply.
Yes.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Ljubo » Thu Apr 14, 2011 9:12 pm

gerigo wrote: In every template you can make module overrides by simply copying the original module template files to catalog/view/theme/YOURTHEME1/template/Module/yourmodule.tpl (yourmodule.tpl can be one of the sidebar modules like newsletter, cart, information, eg.)
In theese files you can style or modify the modules, or simply uncomment or delete the code for not showing up the module in this template.
In other words, you are saying that for different template / store, I could use any module I want, only to rename the .tpl file so it has the same name like completely different module in the primary template?

Active Member

Posts

Joined
Mon Jan 31, 2011 10:07 pm
Location - Serbia

Post by Ljubo » Thu Apr 14, 2011 9:35 pm

Xsecrets wrote:Yes.
even quicker question:
can it be prevented somehow?

Active Member

Posts

Joined
Mon Jan 31, 2011 10:07 pm
Location - Serbia

Post by gerigo » Thu Apr 14, 2011 10:01 pm

I guess youre right concerning the registered customers login. I asked my programmer, this feature is complicated to work with the database and all other modlules and components. Maybe modifications of the corefiles are needed.
Have a look if there's a login module to buy, otherwise we can do it for you for 500-1000 Euros.

Newbie

Posts

Joined
Sat Mar 12, 2011 8:19 am

Post by gerigo » Thu Apr 14, 2011 10:06 pm

You can only change the style or appearance of the installed modules (and enabled in backend)

Newbie

Posts

Joined
Sat Mar 12, 2011 8:19 am

Post by fido-x » Thu Apr 14, 2011 10:15 pm

gerigo wrote:I guess youre right concerning the registered customers login. I asked my programmer, this feature is complicated to work with the database and all other modlules and components. Maybe modifications of the corefiles are needed.
Have a look if there's a login module to buy, otherwise we can do it for you for 500-1000 Euros.
Expensive, especially when the answer is freely available on the forum here

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 gerigo » Thu Apr 14, 2011 10:37 pm

You can try the free mod. (Please give me a feedback if it worked)
As i flew over it seems that your problem still isn't solved...

Newbie

Posts

Joined
Sat Mar 12, 2011 8:19 am

Post by Ljubo » Fri Apr 15, 2011 2:21 am

I have tried this modifications and feedback follows in that topic.

thank you all for your comments.

Active Member

Posts

Joined
Mon Jan 31, 2011 10:07 pm
Location - Serbia

Post by fido-x » Fri Apr 15, 2011 4:51 pm

The information module is already "multi-store" compatible, as the entries displayed are based on the store id. The main issue is with product modules (latest, featured, specials, bestsellers) and the category module, which still display even if empty.

The "product" modules can be "multi-stored" very easily by wrapping the contents of the template file inside an "if" statement. Insert:

Code: Select all

<?php if ($products) { ?>
as your first line, before:

Code: Select all

<div class="box"> 
then, at the very end of the file after the last "</div>", add:

Code: Select all

<?php } ?>
to close the "if" statement.

If there are no products, the module will not display.

For the category module, change the above "if" to:

Code: Select all

<?php if ($category) { ?>
Don't forget to add:

Code: Select all

<?php } ?>
at the end.

If there are no categories, the category module will not display.

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 Ljubo » Fri Apr 15, 2011 5:25 pm

thank you for sharing this.

I think it is also important to be able to show / not show other modules as well.
I suppose the similar changes would be enough, am I right?

stupid example, I want for a custom module, lets say a calender, to be showed in store1 but not showed in store2.

I mean to add somewhere in the begining the line like:
<?php if ($modulename) { ?>
and, at ending to close it with:
<?php } ?>

Would that be enough?

Active Member

Posts

Joined
Mon Jan 31, 2011 10:07 pm
Location - Serbia

Post by fido-x » Fri Apr 15, 2011 5:55 pm

Ljubo wrote:thank you for sharing this.
No worries.
I mean to add somewhere in the begining the line like:
<?php if ($modulename) { ?>
and, at ending to close it with:
<?php } ?>

Would that be enough?
No. As far as the "product" modules and the category module are concerned, all the "if" does is check to see if there is any content for the module to display, and "hides" the module if there isn't any, rather than show an empty module.

For example, to hide the shopping cart module when there is nothing in the shopping cart, you could use:

Code: Select all

<?php if ($this->cart->hasProducts()) { ?>
... cart code ...
<?php } ?>
then, the shopping cart will only display if there is something in it.

Using something like:

Code: Select all

<?php if ($modulename) { ?>
... module code ...
<?php } ?>
will only check if the module exists, not whether there is actually anything in it, and will not prevent the display of an "empty" module.

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 Ljubo » Fri Apr 22, 2011 1:09 am

gerigo wrote:You can only change the style or appearance of the installed modules (and enabled in backend)
Ok, I have just tested it.

I have SimpleHTML module installed and have enabled it to both stores, 1 and 2.
- for the store 1, I use this module-space for displaying the day, date, and clock (found a java script for that, you can paste the code into HTML box of the backend and it works)
- for the store 2, I use this module-space for things that could be seen only to logged in customers of that second store. So, I have found the way to enter the code to display some warning notice to the unregistered customers and to display its real content once the user logs in.
And that is perfect!

But, I had to have some article look, as the Information module has, so, that when a registered customer clicks on an item in the module, that link to get him to another article page displayed like in information module.
So, I created and installed a copy of Information module but now the module displays for both stores with the same name (remember, with SimpleHTML module, you could name the same module differently for two stores).

Finaly, I got an idea to try to delete all the contents of the .tpl file of that copy of Information module, while it is still enabled in the backend.
The result is excellent, module is active but not showing, just the way I need it.
I will now put the contents like articles in that new module, to copy the exact links, and just paste them into SimpleHTML Module, so that it all works like I need.

O0

Active Member

Posts

Joined
Mon Jan 31, 2011 10:07 pm
Location - Serbia
Who is online

Users browsing this forum: No registered users and 18 guests