The purpose of this thread is to compile everything into one thread on how to restrict users / customers / customer groups.
I have a project on at the moment which requires certain customers access to products only for them and not anyone else or the average joe.
After a huge amount of searching, I’ve found the only solution until the customer group restriction comes into effect that the only method of restricting products or product categories from showing to only a selective group of user accounts is to create stores for each ‘customer group’ so to speak, where by the admin will add the accounts to the store in which they can use.
The main store will act as a portal, e.g.: http://www.domain.com where the additional stores such as http://www.domain.com/store1/ will act as a store showing products for a select group of registered users.
To do this, I need to restrict each addtional store to only show if the user is registered, else it will display a login page with the register functions removed to avoid the average joe from being able to register and then view the products that they arn’t ment to.
Adding some wrapping code to check if the user is logged in, I assume that this can be wrapped around in the main layout page:
Taken from: http://www.magentocommerce.com/boards/viewthread/11653/
<? if(Mage::getSingleton( 'customer/session' )->isLoggedIn() == 0)
echo "not logged in";
else echo "logged in";
echo $this->getChildHtml('content'); ?>
I’ve not checked if this will work or not, but it looks promising, this will then only allow the admin to create a user in each store, rendering the additional stores useless to anyone who hasn’t been added by the admin.
This is the part that makes me bit nervious, is that I need the admin to create new stores on the fly, effectively creating new stores for new groups of customers as and when they need them. As far as I know in order to create a new store a dir on the ftp needs to be created along side a duplication of the index.php and htaccess dumped into this, on top of this some modification to both index.php and htaccess needs to be made, then new stores can be created in the admin? I’m assuming there is no method even with 1.1 to create new stores on the fly via only the admin, so the average joe with no coding experience can create these new stores rather than having access to the ftp. If this is not the case, and the only method of creating new stores is with the addition of some php/htacces duplications, htaccess/index.php modifications then this will force me to manually create 50 - 300 stores, then add more as they need it.
If I need to create all these additional stores it will also mean that they will need a lot more faster, and will have to remove customers from some stores to be able to reuse them, which will also then remove all order history of the customer.
Not the most ideal way.
This is the part I have no idea on, how can I tell the person whos registered on “www.domain.com/storea” that when they goto “www.domain.com” they need to goto storea in order to view their products when the customer accounts are seperate from the main store and the sub stores?
The only alternative is a manual email giving the user the url to use to access their products.
What to use the main store for? this would render the main store obsolete and effectively useless beyond self promotion, as I have no control over what is said to customers who are registered in the sub stores, I can’t pin point url paths to the stores they belong to, so the only use for the main store is a self promotion standard style site with no products.
Some interesting other posts i’ve found on restricting access to users, taken this from another post located here: http://www.magentocommerce.com/boards/viewthread/10908/
Following onto next post as this post is limited on char amounts…