Jump to content

Restrict product access to certain groups


hsmonline

Recommended Posts

I need to hide products based on customer groups. I need ALL products (hidden and visible) to be in the same category. I KNOW I can create a separate category to put all products in that I want to hide, but this is not what I want.

I need hidden products together with the visible products and when a certain group member logs in they can see the hidden products along with everything else, so it's seamless.

There's a module for opencart that does exactly what I need, so am wondering if there is anything else out there that is similar to this for prestashop: http://www.opencart.com/index.php?route=extension/extension/info&extension_id=5130

Even a workaround would be fine (as long as it doesn't involve double products).

Thanks for any suggestions.

 

 

 

solution:

 

module for prestashop: https://www.prestashop.com/forums/topic/385000-module-groups-access-to-products/

module for prestashop: https://www.prestashop.com/forums/topic/385000-module-groups-access-to-products/

Link to comment
Share on other sites

  • 2 weeks later...

Have the same problem.. works fine with the categories, but the products can be acessed by everyone..

 

I think if I add this code of CategoryController in the ProductController will work:

 

if (!$this->category->checkAccess($this->context->customer->id))

{

header('HTTP/1.1 403 Forbidden');

header('Status: 403 Forbidden');

$this->errors[] = Tools::displayError('You do not have access to this category.');

$this->customer_access = false;

}

 

But which line i put this?

Edited by FelipeGallo (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Hi!

 

Same here... i want to restrict specific group to access specific product..

 

I think this code is the solution but i dont know how it works or what is this for...

 

ProductController.php Line 118-119

 

elseif (!$this->product->checkAccess((int)self::$cookie->id_customer))

$this->errors[] = Tools::displayError('You do not have access to this product.');

 

my prestashop version is 1.4.8

Link to comment
Share on other sites

after working on this...

 

I notice that my product was set to two categories Home and Category1

then when i remove this product to Home category and set Category1 to specific group

all products found in Category1 was restricted to access even if you are not login or login as default user...

this is good!

 

But the problem is i want to include this product to other categories without restriction

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
  • 3 months later...

I have found that I can address many of my needs by activating and using PS multi-store functionality. Users in one store do not see the products in another store, but in the back office I can control all products from one place. A product can appear in all stores, or in one store, or in those stores I assign it to. If the user groups you have are different enough, this is a great way to solve the dividing up issues. There are other challenges in working iwith multi-store, like quantity management and sharing category issues, that take a while to figure out. But so far, I'm quite pleased with the multi-store functionality.

  • Like 1
Link to comment
Share on other sites

  • 2 months later...
  • 5 months later...

This functionality exists in most other carts. I am now also in need to restrict certain products from being visible until you login with an account. I have a particular brand that cannot be displayed to the general public, but it is ok to sell to "customers"... but they need to be in the same category as their non-restricted companion products for shipping/discount purposes...

 

Has this been addressed??

Link to comment
Share on other sites

  • 8 months later...
  • 1 year later...

Hi guys 

How do I restrict one product for sale in France while allowing the same product to be sold in other countries. Other products in the same catagory can also be sold in France,

I hope my question is clear. 

Thanks for any advice, I am stuck at the moment. 

Kind regards

 

Len

Link to comment
Share on other sites

  • 4 weeks later...

after working on this...

 

I notice that my product was set to two categories Home and Category1

then when i remove this product to Home category and set Category1 to specific group

all products found in Category1 was restricted to access even if you are not login or login as default user...

this is good!

 

But the problem is i want to include this product to other categories without restriction

 

Hi Kelvs,

 

What did you do in your solution? I'm trying to figure out how to do it in ProductController.

 

Thanks!

Link to comment
Share on other sites

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...