Helping a friend with their opencart setup. Tried to search for this topic, but didn't come across this.
Is it possible to setup a multi-store where a customer from one cannot log into the other store?
Meaning the following:
1. User creates an account on Store 1
2. Goes to Store 2 and the same account credentials are not valid
From what it seems and currently based on my test, the user can go to Store 2 and login using the same credentials
Thanks. Any help is appreciated.
I don't know of anyone that offers this as an extension.
Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products
True.mystifier wrote:This is not possible with the standard system.
Ah, no. The store_id is stored in the customer table already.You would have to implement a customer_to_store table linking customers to a store_id...
Restricting customers to the store at which they registered their account hasn't been implemented. Modifications need to be made to "system/library/customer.php" to enable it.
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!
Store_id is always set to default '0' but if you set it to the current store_id in catalog/controller/account/create.php, you are half way there.
Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products
I've made some modifications to "system/library/customer.php" so you can get the customer's store with "$this->customer->getStoreId();". The attached zip file contains the modified file. Unpack it and copy the "customer.php" file to "system/library" (make sure you back-up the original first).
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!
Code: Select all
if (!$this->config->get('config_store_id')) {
if ($this->customer->getStoreId() != 0) {
if ($this->customer->getStoreId() != $this->config->get('config_store_id')) {
$this->load->model('setting/store');
$store_info = $this->model_setting_store->getStore($this->customer->getStoreId());
$this->redirect($store_info['url']);
}
}
}
Code: Select all
unset($this->session->data['guest']);
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!
Can this be hide, like one user just see you store back end?
Thanks.
with user/pass of the 2nd store I tried to login into 1st store.
the result was simple redirection to the home page of the 2nd store.
I would prefer if I would be automatically logged in to the 2nd store, not simply redirected, but OK, this is better than it was in original.
I have logged in (into the 2nd store with its user/pass combination) and was interested what would happen if I try to click to a link for the 1st store.
the result was now that I was logged into the 1st store as a user of 2nd store.
this is not OK...
any solutions for this?
Yes. Insert the following into "catalog/controller/common/header.php" at around line 26:Ljubo wrote:I have tried with the new customer.php and advised modifications in login.php.
with user/pass of the 2nd store I tried to login into 1st store.
the result was simple redirection to the home page of the 2nd store.
I would prefer if I would be automatically logged in to the 2nd store, not simply redirected, but OK, this is better than it was in original.
I have logged in (into the 2nd store with its user/pass combination) and was interested what would happen if I try to click to a link for the 1st store.
the result was now that I was logged into the 1st store as a user of 2nd store.
this is not OK...
any solutions for this?
Code: Select all
if ($this->customer->isLogged() && ($this->config->get('config_store_id') != $this->customer->getStoreId())) {
$this->redirect(HTTP_SERVER . 'index.php?route=account/logout');
}
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!
I would like to have a module that is displayed but only to logged in customers. For the public, it should not be showed.
For example, a copy of information module, with several items inside.
Few of them to be visible to all (public and registered users), while all items to be visible only to logged in users.
All of this would be implemented to only one store of the multistored OC.
Any ideas please?
Hi!fido-x wrote:Yes. Insert the following into "catalog/controller/common/header.php" at around line 26:Ljubo wrote:I have tried with the new customer.php and advised modifications in login.php.
with user/pass of the 2nd store I tried to login into 1st store.
the result was simple redirection to the home page of the 2nd store.
I would prefer if I would be automatically logged in to the 2nd store, not simply redirected, but OK, this is better than it was in original.
I have logged in (into the 2nd store with its user/pass combination) and was interested what would happen if I try to click to a link for the 1st store.
the result was now that I was logged into the 1st store as a user of 2nd store.
this is not OK...
any solutions for this?Then, if a customer who is logged in to one store tries to move to another store where they are not registered, they will be logged out. Does that suit?Code: Select all
if ($this->customer->isLogged() && ($this->config->get('config_store_id') != $this->customer->getStoreId())) { $this->redirect(HTTP_SERVER . 'index.php?route=account/logout'); }
I have tried this on the latest Open Cart version with no success, is there a possibility that some one could do the exact same thing for the new version?
THank you!
I have 2 stores, store1=default with visible prices, store2=wholesale, with prices only visible at login.
It seems to be working if I try to login in store2, with a user from store1. It straight goes to the logout function (need to adapt the message a bit, so that people understand why they are suddenly logged out).
But if I try with a user from store2, to login store 1, it errors out with:
Fatal error: Call to undefined method ModelSettingStore::getStore() in /home/www/store1domain.com/catalog/controller/account/login.php on line 56
line 56 = $store_info = $this->model_setting_store->getStore($this->customer->getStoreId());
After reading some, I understand that the default store doesn't have a StoreID
(http://code.google.com/p/opencart/issues/detail?id=914)
what to do?
$store_info = $this->model_setting_store->getStores($this->customer->getStoreId());
(getStores instead of getStore).
Seems to be working now, will do some more testing.
If anybody wants to know what I did, please reply to this thread..
Allows the same customer email address to generate unique customer accounts per store. As a result all transactions are completely isolated by store.
ie.
demo@demo.com = store_id 1 customer_id 1
demo@demo.com = store_id 2 customer_id 2
demo@demo.com = store_id 3 customer_id 3
- Allows a set-up where one user has access to several stores, but not all of them (just check their customer group for every store they should have access to)
- Allows a set-up where different customer groups have access to the same store (just check all these customer groups for that store)
You can find the extension here: http://www.opencart.com/index.php?route ... n_id=16048
Users browsing this forum: No registered users and 195 guests