Jump to content

2 shopping carts 1 sql data base


Guest degsey69

Recommended Posts

Guest degsey69

I want to run 2 shopping carts from one sql database but with 2 different price structures, ie one retail site and one trade site.

I expect that I will have to creat a subdomain with my ISP to accomadate this , has anybody done this or know how to? :P

Link to comment
Share on other sites

Guest degsey69

Basically I want to perhaps use different skins, obviosly host with the same ISP with the new domain on the server and have the same products, images, etc just a different price per product.

Or

Can cubecart accomadate duel pricing according to log in, say when the trade log in a different price structure is displayed to the normal shopping cart?

I want the easeist solution. :P

Link to comment
Share on other sites

Guest limkimpoh

Am i able to let my stores share just the customer database ?

i.e. 2 or more different online stores selling different merchandise, different prices, everything different but same customer base, so when a customer registers on one my stores he do not have to register again and again for my other stores.

Any way to incorporate just the cutomer database together ?

Thanks :blink:

Link to comment
Share on other sites

Guest estelle

You could do this, but you would have to make small changes all over the place. Firstly you would need to have installed CubeCart twice and used a different database prefix each time.

And then in your database you delete the second (empty) customer table and rename the original table to CubeCart_customer rather than e.g. store1_CubeCart_customer. You would use phpMyAdmin to do this.

Then you could search for this string:

$glob['dbprefix']."CubeCart_customer"


and *everywhere* you find it you could replace it with this string:


"CubeCart_customer"

Note that Windows "Find" command won't get you through it. You'll need to download a proper file search program.

I'm not guaranteeing that this would work :(

Estelle.

Link to comment
Share on other sites

Guest limkimpoh

woot... that sounds a lot of editing work to do with no guarantees it might work.

can i "cut & paste" database ? i.e. back up one customer database from one store and upload it into the database of the other ? reckon its simpler to do this but manual work.

Link to comment
Share on other sites

Guest estelle

Yes, you could do that. Or you could modify the customer registration & profile update code so that both tables are updated at the same time.

Something else to keep in mind, regardless of whether you use a shared customer table or a separate (copied) customer table, it that customers will always have to log in to each store separately.

Link to comment
Share on other sites

Guest limkimpoh

yes i get that point, i just wanna eliminate the need to re-register over and over again for my customers, filling in all the address and phone numbers and such...

logging in seperately is no issue

Link to comment
Share on other sites

Guest limkimpoh

erm, how do i add command to update both databases simultaneously ?

$record["email"] = $db->mySQLSafe($_POST['email']);

$record["password"] = $db->mySQLSafe(md5($_POST['password']));

$record["title"] = $db->mySQLSafe($_POST['title']);

$record["firstName"] = $db->mySQLSafe($_POST['firstName']);

$record["lastName"] = $db->mySQLSafe($_POST['lastName']);

$record["add_1"] = $db->mySQLSafe($_POST['add_1']);

$record["add_2"] = $db->mySQLSafe($_POST['add_2']);

$record["town"] = $db->mySQLSafe($_POST['town']);

$record["county"] = $db->mySQLSafe($_POST['county']);

$record["postcode"] = $db->mySQLSafe($_POST['postcode']);

$record["country"] = $db->mySQLSafe($_POST['country']);

$record["phone"] = $db->mySQLSafe($_POST['phone']);

$record["mobile"] = $db->mySQLSafe($_POST['mobile']);

$record["regTime"] = $db->mySQLSafe(time());

$record["ipAddress"] = $db->mySQLSafe($_SERVER['REMOTE_ADDR']);

where and how do i insert a command to, say, update A_database CubeCart_customer and B_database CubeCart_customer ?

Link to comment
Share on other sites

That won't work Estelle as all the actual database calls are in the DB class file. You could rewrite that to do a mysql_db_query instead of a mysql_query. Then you'd need to add the proper database into each call. It would then be necessary to create a separate DB class or function(s) to query and update/insert the 2nd database.

Regardless, it would be a VERY complex undertaking and NOT for the faint of heart or novice PHP/MySQL programmer. I personally wouldn't touch that job for less than $600-$800....maybe more.

The only way I could see to justify the costs would be for a mall type of store installation where the owner had several different stores linked together. Of course if you were going to do that, I'd also add in a way to offer a unified checkout across all the stores. With all that in mind, >$1200 to build it based on a custom CubeCart version....and that wouldn't count the likely several customized skins to make each "store" have it's own look.

:(

Link to comment
Share on other sites

Guest estelle

Of couse, searching for UPDATE/INSERT will not work since its done as a $db->update() or $db->insert() call.

I know that it may not be easy, but if all you wanted to do is have a single CubeCart_customer table, then surely you could just remove the $glob['dbprefix'] from in front of every "CubeCart_customer", and obviously delete one customer table and rename the other, then it would work wouldn't it?

Link to comment
Share on other sites

Yes, IF both stores ran out of the same database. You could use separate prefixes within one DB for the two sets of tables then rewrite the customer interaction sections to use the same customer table(s).

:(

Link to comment
Share on other sites

Guest estelle

Right, of course... i've only ever used a single database so i forget that many other people have multiple databases. But this would definitely be the easiest way... not that i'm offering to do it! :(

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...