Post by Jan R » Thu Oct 22, 2009 11:51 am

Jan here... Ok Guys I have a fun one... :D

I want to know if it is possible to have 2 stores
[lets say one on the main domain and the other in a sub domain]
Each having there own db. [this is normal so far]
Now the challenge ... BUT have store #2 use the products db table of Store #1

So in other words..
I want to have two sites that pulls from the same product inventory
The prices, looks, customers, etc. will differ for each site. I just need the two to link the same inventory.

The simple answer would be to export the products table from one store and import it in to the other. but I need to keep the stock available in sync. because some of the products have a low limited number.

Any ideals? ;D
-=:@:=-

User avatar
New member

Posts

Joined
Fri Oct 16, 2009 2:20 am

Post by readyman » Thu Oct 22, 2009 1:44 pm

yeah, that's easy... you want two separate stores both with separate databases except for one grabbing the categories and products from one database.

This would require customizing the model files for one installation.

http://www.alreadymade.com
Follow me on twitter.com/alreadymade


User avatar
Global Moderator

Posts

Joined
Wed May 20, 2009 5:16 am
Location - Sydney

Post by sgfx » Thu Oct 22, 2009 11:10 pm

Hi Jan. (love the costume)
If you modify your store and modules then remember that some place you will have to integrate a connection to the second db..
Here is another option.
You might consider some form of php script that could be ran by a crone process that would log into each MySql db compare and then sync the appropriate table (product).
This could be run once a day or hour or minute, depending on how busy your stores were.

This would allow you to have 2 clean stores that you can upgrade easily without having to re-customize the script after upgrade.

I am not a real programmer and don't know how to make such a program but perhaps someone here could give you a hint or two if it sounded like this would be a doable option.

User avatar
Newbie

Posts

Joined
Thu Oct 08, 2009 9:56 am

Post by theclownoftightness » Mon Oct 26, 2009 1:06 am

Of course its possible!!!! That's the power of PHP. As stated above. Youd have to kill the connection to your first db. then retrieve the categories/products you want. Then reconnect to the database 1. I run multiple stores off of one database. I put a field in the products database that stores a numerical array of the stores I want to the products to appear on... Ill try and put together what I've built already in to a module if you'd like.

theclownoftightness

New member

Posts

Joined
Wed Mar 11, 2009 4:55 pm

Who is online

Users browsing this forum: No registered users and 138 guests