Post by fido-x » Fri Apr 30, 2010 3:14 pm

Objective
Create 2 "sub" stores of your main store, called "store_1" and "store_2".

Assumptions
XAMPP for Windows
XAMPP installation directory: C:\xampp
OpenCart Store directory: C:\xampp\htdocs\store
Main Store URL: http://localhost/store

Edit Apache Configuration File
What we are going to do is create an "alias" for each store.
Open the Apache configuration file (C:\xampp\apache\conf\httpd.conf) and find the section that starts with "<IfModule alias_module>", and insert the following inside this section:-

Code: Select all

Alias /store_1 "C:/xampp/htdocs/store"
Alias /store_2 "C:/xampp/htdocs/store"
Then restart your Apache server from the XAMPP control panel.

There are 2 things you should note about the above alias entries:
(1) Forward slashes are used for directory paths in the Apache configuration file, NOT backslashes as would normally be used in Windows.
(2) Both aliases point to the same directory - your main store's directory. This would be the same for any other "sub" store you may wish to create.

OpenCart Configuration
Log in to your administration and from the menu, select "System->Settings" and create 2 new stores. You can call them whatever you want.
Give one a Store URL of "http://localhost/store_1/" and the other a Store URL of "http://localhost/store_2/".

You should now be able to access your new stores at "http://localhost/store_1" and "http://localhost/store_2", with your main store still at "http://localhost/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
Newbie

Posts

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

Post by Qphoria » Fri Apr 30, 2010 10:14 pm

Awesome. Thanks for this

OpenCart 2.0.x Mod Update Info

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by buckmajor » Sun May 16, 2010 11:17 pm

Cool! Are we able to build Multi-Store when we go online? If so, what are the maximum stores to have on one website?

Thanks in advance
CHEERS :)

http://www.dmaireroa.com


Newbie

Posts

Joined
Tue May 04, 2010 11:29 am
Location - Brisbane

Post by SteveSherry » Mon May 17, 2010 6:27 am

This has worked very well for me, and I can really see this working in the future.
Does anyone know how to apply this to a website?

I assume that I'd need to have 2(or more) domain names on the one hosting account, but i'm not sure.
I'm with UK fasthosts, and they are not the most helpful on support.

My Website ¦ Summer Madness Special Offer ¦


Newbie

Posts

Joined
Thu Apr 08, 2010 7:47 am
Location - Wirral, UK

Post by cmebd » Mon May 17, 2010 7:51 pm

Could Fido's helpful piece be put into the Documentation please?

A stupid question is the one you -don't- ask.........(Anon)

)C1.5.0.1 (IN devel)
OC V1.4.9.5
OC V1.4.9.2
OC V1.4.7
OC V1.3.4


User avatar
Newbie

Posts

Joined
Fri Nov 13, 2009 11:17 am
Location - Tasmania, Australia

Post by SteveSherry » Tue May 25, 2010 8:24 pm

I've now moved to another host and have set up multi-store.
it works like a dream.

there area few little "problems", but these are related to modules etc not being restricted to one store, but in general it is a great idea.

My Website ¦ Summer Madness Special Offer ¦


Newbie

Posts

Joined
Thu Apr 08, 2010 7:47 am
Location - Wirral, UK

Post by nzoli » Wed Jun 02, 2010 10:46 pm

Thanks for this! It's working!!
I have a question too :)

How do I specify a different addresses in my shop (not url)?
So the main 1. shop's address is e.g. Paris Eiffel street, the second shop's address is Budapest Heroes square....

thanks again

Newbie

Posts

Joined
Mon May 17, 2010 7:56 pm

Post by SteveSherry » Thu Jun 03, 2010 6:54 am

nzoli wrote:How do I specify a different addresses in my shop (not url)?
You can't.

Multistore is possibly going to be looked at in future versions, but nothing in the most recent versions, or the upcoming 1.4.8 will handle this.

My Website ¦ Summer Madness Special Offer ¦


Newbie

Posts

Joined
Thu Apr 08, 2010 7:47 am
Location - Wirral, UK

Post by fido-x » Thu Jun 03, 2010 8:13 pm

SteveSherry wrote:
nzoli wrote:How do I specify a different addresses in my shop (not url)?
You can't.

Multistore is possibly going to be looked at in future versions, but nothing in the most recent versions, or the upcoming 1.4.8 will handle this.
I've been doing a bit of work on some kind of "Store Manager" for a client that will do this. I've been trying to keep it as independent as I can but, obviously, modifying some of the core files is unavoidable, especially when it comes to validation of product ownership (individual "store managers" should only be able to see their own products, not those of other users). There's also the issue of what they should be allowed to access in the administration. And then, there's some kind of "payment manager" that needs to be associated with each user, so that payment received for products sold goes to the right store owner. Lot of work!

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
Newbie

Posts

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

Post by karlpers » Mon Jun 07, 2010 11:57 pm

Hi everyone,

I take the chance to ask a stupid question in this thread.

Lets say I want to use the multistore functionality. (only in reason to have more then one language indexing at google)

I havent found any documentation about installing several stores anywere. But tell me what I do wrong:)

1. I installed the "main store" at one domain.
2. I configured the main store to have two stores, the second store was placed at another domain at the same host.
3. I uploaded all files even to the second domain.

I guess there is something missing in the connection between the second store and the admin panel that works for the main store.

How do I configure it? Please, I guess more users would have a step by step guide how to set up multistores.

Thanks!

Newbie

Posts

Joined
Tue Jun 09, 2009 10:35 pm

Post by SteveSherry » Tue Jun 08, 2010 12:14 am

You need to "point" your second domain to the folder which contains your existing OC installation.
this will enable both www.domain1.com and www.domain2.com to run the same installed code.

My Website ¦ Summer Madness Special Offer ¦


Newbie

Posts

Joined
Thu Apr 08, 2010 7:47 am
Location - Wirral, UK

Post by karlpers » Wed Jun 09, 2010 10:14 pm

Hi again,

Thanks for the answer.

Right now I have made a setup at domain1, and have pointed the domain2 to the domain1 and configured a new store via the admin panel as a multistore correctly (I think)

Isnt there any more to do? Right now Im just directed to the domain1 to the same store as the one which is configured as domain2 if im typing in domain2.com..

:/

Newbie

Posts

Joined
Tue Jun 09, 2009 10:35 pm

Post by SteveSherry » Thu Jun 10, 2010 12:02 am

bear in mind that this is adding a domain to your account and then pointing it to the same folder as the other.
it is NOT forwarding one domain to another.

My Website ¦ Summer Madness Special Offer ¦


Newbie

Posts

Joined
Thu Apr 08, 2010 7:47 am
Location - Wirral, UK

Post by MattGSX » Thu Jun 10, 2010 4:53 am

EDIT: I resolved this issue and posted "how" as it was a simple user error, likely the cause of other problems as well.

I'm actually having a similar problem, so I am pretty sure it's not a domain redirect issue.

1. Create subdomain teststore.domain.com.
2. Set document root for teststore.domain.com as public_html/ (doc root for my live store).
3. Set up multistore on domain.com.
4. When I go to teststore.domain.com, it displays my main site, even though I specified a diff. template, etc. Technically, I should have an empty framework, as I didn't specify any products or product categories for my 2nd site.

My thought is it has to do with my .htacess and the way the server is handling redirection. Keep in mind, I'm also using SmartOptimizer (to cache pages server-side to improve load time), and I was trying to handle my www resolve redirect through htaccess, which could also be causing the problem.

Code: Select all

# 1.To use URL Alias you need to be running apache with mod_rewrite enabled. 

# 2. In your opencart directory rename htaccess.txt to .htaccess.

# For any support issues please visit: http://www.opencart.com

Options +FollowSymlinks

RewriteEngine On
RewriteBase / 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA]
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc] 
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$


RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$


<IfModule mod_expires.c>
	<FilesMatch "\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt)$">
		ExpiresActive On
		ExpiresDefault "access plus 10 years"
	</FilesMatch>
</IfModule>
<IfModule mod_rewrite.c>
	RewriteEngine On
	
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^(.*\.(js|css))$ smartoptimizer/?$1
	
	<IfModule mod_expires.c>
		RewriteCond %{REQUEST_FILENAME} -f
		RewriteRule ^(.*\.(js|css|html?|xml|txt))$ smartoptimizer/?$1
	</IfModule>

	<IfModule !mod_expires.c>
		RewriteCond %{REQUEST_FILENAME} -f
		RewriteRule ^(.*\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt))$ smartoptimizer/?$1
	</IfModule>
</IfModule>
<FilesMatch "\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt)$">
	FileETag none
</FilesMatch>
Any thoughts? I know it's not the SmartOptimizer, but I'm thinking maybe SEO URLs + www resolve?
Last edited by MattGSX on Thu Jun 10, 2010 5:02 am, edited 1 time in total.

Newbie

Posts

Joined
Thu May 27, 2010 6:18 am
Location - Oshkosh, WI US

Post by MattGSX » Thu Jun 10, 2010 4:56 am

Edit: Mod, feel free to delete - unnecessary multi-post
Last edited by MattGSX on Thu Jun 10, 2010 5:02 am, edited 1 time in total.

Newbie

Posts

Joined
Thu May 27, 2010 6:18 am
Location - Oshkosh, WI US

Post by MattGSX » Thu Jun 10, 2010 4:59 am

ISSUE SOLVED!

I think that it is the same thing that karlpers is experiencing.

In the multistore setup, you MUST have a / at the end of the address. I had the store set as http://test.domain.com, and it should have been http://test.store.com/.

______________________

Now, I have one more issue that I need to figure out regarding checkout.

I want to allow shoppers from my "multi-store" to use their credit card, which goes through FirstData using the API (not connect). Fortunately, I can send req's from any URL that I want, but my SSL is registered to www.domain.com, so using SSL at http://test.domain.com is out. I obviously don't want customers to enter CC data w/o security, so I need to figure out a way to handle ALL checkout through domain.com instead of individualstores.domain.com and have cookie data transfer.

Newbie

Posts

Joined
Thu May 27, 2010 6:18 am
Location - Oshkosh, WI US

Post by airlinetimetables » Sun Jun 13, 2010 11:30 pm

If you set up multistores, do you have to use separate domains, or could you use subdomains (store1.domain.com, store2.domain.com)?


Posts

Joined
Sat Jun 05, 2010 6:25 am

Post by fido-x » Mon Jun 14, 2010 1:45 pm

airlinetimetables wrote:If you set up multistores, do you have to use separate domains, or could you use subdomains (store1.domain.com, store2.domain.com)?
Yes, you can use subdomains.

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
Newbie

Posts

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

Post by OCyvon2 » Sat Jul 10, 2010 6:45 pm

What do I have to write in de htaccess file when I have two diferent shops on one domain (each in a different subdomein).
something like this:

Code: Select all

Options +FollowSymlinks

RewriteEngine On
RewriteBase / 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ /shop1/index.php?_route_=$1 [L,QSA]
RewriteRule ^(.*)\?*$ /shop2/index.php?_route_=$1 [L,QSA]


OpenCartstore
Gebruikersgids (admin handleiding)


User avatar
Newbie

Posts

Joined
Sun Jan 31, 2010 8:00 pm
Location - Zaandam, The Netherlands

Post by OCyvon2 » Sat Jul 10, 2010 7:11 pm

fido-x wrote:Objective
Create 2 "sub" stores of your main store, called "store_1" and "store_2".

Assumptions
XAMPP for Windows
XAMPP installation directory: C:\xampp
OpenCart Store directory: C:\xampp\htdocs\store
Main Store URL: http://localhost/store

Edit Apache Configuration File
What we are going to do is create an "alias" for each store.
Open the Apache configuration file (C:\xampp\apache\conf\httpd.conf) and find the section that starts with "<IfModule alias_module>", and insert the following inside this section:-

Code: Select all

Alias /store_1 "C:/xampp/htdocs/store"
Alias /store_2 "C:/xampp/htdocs/store"
Then restart your Apache server from the XAMPP control panel.

There are 2 things you should note about the above alias entries:
(1) Forward slashes are used for directory paths in the Apache configuration file, NOT backslashes as would normally be used in Windows.
(2) Both aliases point to the same directory - your main store's directory. This would be the same for any other "sub" store you may wish to create.

OpenCart Configuration
Log in to your administration and from the menu, select "System->Settings" and create 2 new stores. You can call them whatever you want.
Give one a Store URL of "http://localhost/store_1/" and the other a Store URL of "http://localhost/store_2/".

You should now be able to access your new stores at "http://localhost/store_1" and "http://localhost/store_2", with your main store still at "http://localhost/store".
Wow this really works a lot better.
Can you tell me how I can do this online on a real domain?

OpenCartstore
Gebruikersgids (admin handleiding)


User avatar
Newbie

Posts

Joined
Sun Jan 31, 2010 8:00 pm
Location - Zaandam, The Netherlands
Who is online

Users browsing this forum: Google [Bot], JNeuhoff and 76 guests