Jump to content

Sharing Customers In Multistore With Different Domain Names


Recommended Posts

From my understanding and from all the post on this and other forums i have read Multistore works like this:

 

If i want to share customers between shops these shops have to be in the same shop group. It's not possible to share customers between shops in different shop groups.

 

If i want to give each shop a different domain name then these shops have to be in different shop groups or at least not in the default group. Because when i add a shop in the default group and give it a different domain name it only forward me to the default shop.

 

At the moment I have shop1 as default shop in the default group.

What are my options to create shop2 with a different domain name, which will share customer data whit shop1?

Link to comment
Share on other sites

  • 2 months later...
  • 1 year later...
On 8/4/2016 at 2:32 PM, Inform-All said:

So i solved it, instead of keeping 2 groups i just changed the group of my store.

I changed "id_shop_group" in de database table "ps_shop" to the group that i want to use from now on.

 

Old topic, but I hope this may help if someone was in my same situation... I just activated Multistore and created a new shop under a differente domain a few days ago. I was doing some tests and created some test customers. Then I decided to share customers (my fault, I should have made this decision BEFORE) and found the option greyed out.

What worked for me?

1. Delete those test customers of the new store.

2. Go to database table ps_shop_group and set field "share_customer" to 1 (instead of 0) for the existing shop group (in my case it's the only one, so it's id_shop_group = 1)

I tested again creating new users on both shops and it works! (PS Version: 1.6.1.4)

Link to comment
Share on other sites

  • 3 years later...

I know this is an old topic, but i think i've found a solution, at least for PS Version 1.7.7.8

My situation is that I have to share customers within all the stores, but the stock only between store groups. Unfortunately this can't be done, because customers only are shared between groups, and while a costumer was regitered in one store, and he can sign up in other store of the same group, he can't sign up in other group's store.

Investigating about it, I discovered the problem was in the login process, so i looked for how login is done, and found it, in the costumer core class. On it, there is a function which is used for login, public function getByEmail($email, $plaintextPassword = null, $ignoreGuest = true)

On it I found the code that filters the id_shop or id_shop_group while login:

if (Shop::getContext() == Shop::CONTEXT_SHOP && $shopGroup['share_customer']) {
	$sql->where('c.`id_shop_group` = ' . (int) Shop::getContextShopGroupID());
} else {
	$sql->where('c.`id_shop` IN (' . implode(', ', Shop::getContextListShopID(Shop::SHARE_CUSTOMER)) . ')');
}

So, as I want is all costumers to be shared by all shop groups, I made a Override of hte CostumerCore class just with the functions getByEmail and customerExists, removing the id_shop and id_shop_group filters or adapting them to my specifications.

 

Be careful, as this code appears twice on the getByEmail Function

I've looking fo other id_shop and id_shop_group filters related with costumers, and is the only i've found. Now the project is under development, so some bugs may appear. Any thing related I found I'll promise to share

 

 

 

 

Edited by vrobador
Missed one part (see edit history)
Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...