Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need Help in Installing osCommerce Multiple Domains


ammu_omni

Recommended Posts

Posted

Hi,

 

I have New Zealand oscommerce website up and running. This website is highly customized with nearly 15 or more add-ons.

 

I need to put Australian website with all same set of add-ons and features.

 

All the products, categories, images are same for both the websites. But the currencies, banking modules, customers and some other features are just differing.

 

I like use the same database for both the domains, but not the admin. I need to have their own admins for both the domains.

 

I know there are lot of contributions for installing a multi-domain with same database. But my website is highly customised so I'm bit confused to use which contribution.

 

Please suggest me a contribution or addon to make multiple websites with each of their own admin but with single database.

 

Thank You.

Posted

Sorry, but why would you want different admins but the same database? I would suggest to keep it simple and use two completely independent sites. This also gives you more flexiblity once you want to develop the sites differently. Otherwise you are just asking for trouble (if it is possible at all what you have in mind; at least none of the contributions I could find would do this, as they would just present exactly the same content under different domains).

 

Thomas

Posted

@@ammu_omni

 

Sharing databases is just looking for trouble. I know it has been done, but from my past experience the end result is usually using two independent websites. If stock levels is the concern, you could import levels daily from one to the other to keep them in sync.

 

 

 

Chris

Posted

Actually, it occurred to me that I did something similar a few years ago when I set up a bilingual forum. Although this does not involve different domains, I did this by setting up two different installations connected to the same database. So you could do something similar here:

 

1) Copy your catalog files in two different folders nz/ and au/ in your root folder.

 

2) Prefix all the table names in includes/database_tables.php with nz_ and au_ respectively apart from the product related tables (and any other that you want to be identical for the two sites). Also, change all the country and domain specific details in the corresponding files like includes/configure.php and the language files.

 

3) Rename all the tables in your present database to have the prefix nz_ apart from the product related tables (and any other that you want to be identical for the two sites); then run a query on this database that adds all the relevant tables with the au_prefix instead. So now you have effectively two databases in one, with the (unprefixed) product related tables belonging to both of them.

 

 

4) Now in your root folder put the following .htaccess file

 

 

RewriteEngine On

 

RewriteCond %{REQUEST_URI} "!/nz/"

RewriteCond %{HTTP_HOST} ^(www\.)?mydomain\.co\.nz$

RewriteRule ^(.*)$ /nz/$1 [L]

 

 

RewriteCond %{REQUEST_URI} "!/au/"

RewriteCond %{HTTP_HOST} ^(www\.)?mydomain\.com\.au$

RewriteRule ^(.*)$ /au/$1 [L]

 

 

 

This should pretty much do it, but consider this more as a broad outline rather than a tried and tested instruction. There may well be issues that have to be addressed additionally.

 

Thomas

Posted

Actually, it occurred to me that I did something similar a few years ago when I set up a bilingual forum. Although this does not involve different domains, I did this by setting up two different installations connected to the same database. So you could do something similar here:

 

1) Copy your catalog files in two different folders nz/ and au/ in your root folder.

 

2) Prefix all the table names in includes/database_tables.php with nz_ and au_ respectively apart from the product related tables (and any other that you want to be identical for the two sites). Also, change all the country and domain specific details in the corresponding files like includes/configure.php and the language files.

 

3) Rename all the tables in your present database to have the prefix nz_ apart from the product related tables (and any other that you want to be identical for the two sites); then run a query on this database that adds all the relevant tables with the au_prefix instead. So now you have effectively two databases in one, with the (unprefixed) product related tables belonging to both of them.

 

 

4) Now in your root folder put the following .htaccess file

 

 

RewriteEngine On

 

RewriteCond %{REQUEST_URI} "!/nz/"

RewriteCond %{HTTP_HOST} ^(www\.)?mydomain\.co\.nz$

RewriteRule ^(.*)$ /nz/$1 [L]

 

 

RewriteCond %{REQUEST_URI} "!/au/"

RewriteCond %{HTTP_HOST} ^(www\.)?mydomain\.com\.au$

RewriteRule ^(.*)$ /au/$1 [L]

 

 

 

This should pretty much do it, but consider this more as a broad outline rather than a tried and tested instruction. There may well be issues that have to be addressed additionally.

 

Thomas

 

 

Hi Thomas,

 

Thank you for your reply.

 

I'm not trying to have a multi admin. I thought that will be easy for setting the currency for NZ and AU and also for some other features.

If it is possible to have it with one admin then I'm pretty happy to do that.

 

The oscommerce site is not develop by me I'm new to oscommerce but I tried to crack it down and I'm not good at it.

 

I've 2 domains and I have uploaded the coding (the whole htdocs folder in both domains) and I changed the config files with correct links.

 

At the moment I can login into both the admins (NZ and AU) but when I change some thing like if I change the currency its changing in both the sites. I know I copied the whole htdocs from NZ website to AU website and I just changed the config files.

 

So can you please tell me the procedures in a more clear way please.

 

Thank You.

 

Prasath.

 

Posted

@@ammu_omni

 

Sharing databases is just looking for trouble. I know it has been done, but from my past experience the end result is usually using two independent websites. If stock levels is the concern, you could import levels daily from one to the other to keep them in sync.

 

 

 

Chris

 

Hi Chris,

 

Thank you for your reply.

 

I'm not going to maintain the stock levels in the website. We have entirely different internal system to maintain the stocks. We are going to just get the order or the purchases made by the customers to our mail. so that not the problem.

 

I'm going to make our company website up and running in almost 11 different countries with Multilanguage. For some of the countries for example New Zealand and Australia the entire data of the website are same except the currency, customers and some other features. So I thought maintaining with single database and if possible single admin will be easy.

 

Can you please suggest a contribution to have multi domain with single database and admin.

 

You can see my other posts to have clear view of what I'm doing.

 

Thank you.

 

Prasath.

 

Posted

 

Hi Nick,

 

Thanks for your reply.

 

This contributions is making us to change a lot of coding is like trying to replace. But my oscommerce website codes are high customised with a lot of contributions.

 

So can you please suggests me any other contributions or any other way of working with the contribution that you mentioned.

 

Thanks.

 

Prasath.

Posted

This may sound silly, but are you not trying to over complicate things.

 

I take it the various domains would be selling the same products, so could you not just have several currencies and languages set up on the same store, as oscommerce is designed to be set up. Customers could then choose whatever language they wanted, which would also change the currencies. You could then havew various domains using thre same database. If you have stores in various locations you could then add something to allow various people access to parts of the admin area so parts can be added It would get more complicated if you shipped from different addresses, but I expect something is available.

 

Failing that, could you somehow control the currencies by the users ip address. Just a thought that last one.

REMEMBER BACKUP, BACKUP AND BACKUP

Posted

 

So can you please tell me the procedures in a more clear way please.

 

Hi Prasath,

 

Like I said, you have to add different prefixes to the table names. First of all, export your whole database from phpMyAdmin so that you have a backup.Then in phpMyAdmin (with your whole database selected) click 'Structure' and tick all the tables. Then in the selection box 'With selected...' select 'Add prefix to table' and add the prefix nz_ to all tables. Now all your tables should have the nz_prefix. Then import the previously saved database (without the prefixes) again. Now add the prefix au_ in the same manner to all the tables without a prefix. You now have all the tables in the database doubled up, one with an nz_ and one with an au_ prefix. Now select all the tables with an nz_ prefix that you want both sites to share (e.g. like the product related tables) and remove the prefix for those again by selecting the 'Replace Table Prefix' option. Then tick the corresponding tables with the au_prefix and delete those altogether by selecting selecting 'Drop' for those (you could leave them as well in place, but they would not serve any purpose)

 

You then just have to add the corresponding prefixes in includes/database_tables.php and admin/includes/database_tables.php for both sites.

 

That should be it. There is no code to change (and you neither need the rewrite rule I mentioned above if you have both sites already in place under their respectice domains).

 

If you now make changes in the admin of either site, only those will change on the other site as well where the correspondig table has no prefix.

 

Thomas

 

P.S.: Nick's suggestion is actually not what you want. You don't want to handle different stores, but the same store under different domains.

Posted
P.S.: Nick's suggestion is actually not what you want. You don't want to handle different stores, but the same store under different domains.

My suggestion is flexible and can be used for just 1 store too with the same products but different urls, different languages and more. In addition It also offer the option of controlling which stores to show which categories and products in, so you can have "unique" regional products too.

Posted

@ toyicebear

 

The install file for the 'multiple shop' contribution says this:

 

Therefore, each store is independent of the other with regards to the store product catalog, categories, specials, manufacturers, and other configuration data.

 

The customers, address_books are currently not independent but utilizing this framework could easily be made to be so -- albeit harder to then manage via the admin

 

This is actually exactly the other other way around to what ammu_omni wants to achieve, not to mention the fact that it is less than straightforward to install this contribution for a heavily modified cart.

 

Thomas

Posted

What it states is that if you have several shops a customer can only register in one of the shops (with the same email address that is). Then again its not too hard making it so that a customer can register in any number of the shops.

 

In this case that would not mater anyhow since each shop would be regional and as such would not "share" the same customers.

 

The method you mentioned i have helped shops set-up in the past too, and yes it is a workable solution within its limitations.

Posted

@@ammu_omni The addon Nick mentioned is meant to do what you want. It is a major change and will be a pain to merge into your code and when making future changes, but it will handle all of the little details one doesn't think about when doing something like this. If you don't want to install that, you can copy the shop side of the main shop to the second shop and then setup the configure file to load the main shops database. There will be a problem with the payment modules since you said they have to be different so the ones to be used will need to be modified to be enabled/disabled based on the shop being accessed. Other modules may need this change too. If there is a problem with the currency not being correct for the shop, that would have to be edited too. And when an order is placed, it will use the main shops name and location so if you want that to be different, that would have to be edited too. So, it is posible to do it manually but, I think, once you have finished making all of the adjustements, you would be in about the same situation that you would be in if you installed Multi-stores. Personally, I think you would be better advised to run two different shops based on my experience with shops that done this.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...