first1 Posted August 23, 2009 Share Posted August 23, 2009 how can i restrict a group from accessing certain categories? Link to comment Share on other sites More sharing options...
Raver Posted August 24, 2009 Share Posted August 24, 2009 You can assign users to groups and select groups with access to a particular category.Simply put products into the right groups.version 1.2.0.7 has bug that found my products that are not supposed to be visible but the version after that has since fixed this issue, thanks to the wonderful work of the Prestashop Team.Hope this helps. Link to comment Share on other sites More sharing options...
first1 Posted August 24, 2009 Author Share Posted August 24, 2009 thanks for making the effort but no it does not help.I have a category that is available for the online (default) users.I want that category NOT to be accessible to me other group.But in prestashop, if you add a category to the online(default) then every other group will see it.any thoughts? Link to comment Share on other sites More sharing options...
ningu Posted August 24, 2009 Share Posted August 24, 2009 In the category configuration adlin page, you have the list of groups for which the category is accessible (checkbox list at the botton) Link to comment Share on other sites More sharing options...
first1 Posted August 24, 2009 Author Share Posted August 24, 2009 yes, i have seen that//I dont know why you dont seem to understand my issue...let me explain it again clearer:I have 2 groups:1)i have retail customers that just find me on google and buy my products (they get automatically assigned to 'default' group/online group)2)I have shops (wholesale customers) that i have them in a group with 30% discount , the group it is called 'wholesale'i have 2 categories:1)category selling TVs (for that i can afford giving the wholesale customers 30% and the online 0%... so all good with this one2)category selling cameras, Icannot afford to give 30% on cameras to wholesale. so i have only the online checkbox checked.however, my wholesale customers can still see this category and they can buy cameras with 30% discount.how can i restrict the wholesale from accessing the camera category. becasue i cannot give them discount on it?the problem is, when you tick a category for the default group. every other group will be able to access it.how can i change that so only online default fgroup can access it? Link to comment Share on other sites More sharing options...
first1 Posted August 24, 2009 Author Share Posted August 24, 2009 actually i think you aswered me right, i will try your suggetion and let you know thanks alot ningu Link to comment Share on other sites More sharing options...
ningu Posted August 24, 2009 Share Posted August 24, 2009 Try on a v1.2.1.There's issue in earlier version, products are still accessible whereas their category is not accessible (has been fixed in 1.2.1) Link to comment Share on other sites More sharing options...
nimuravka Posted August 24, 2009 Share Posted August 24, 2009 hi all,let me join to this topicI have a similar question.At this moment I have 3 customers groups. 1st - defaul for everyone, 2nd - my regular clients with dicount. Both 1 and 2 goups are for all categories exclude 1. And 3d group is for clients forall categories include that one my 1 and 2 can't use.. With 1 and 2 everything is clear. With 3d: if you are in this small group you can see this category and buy it's products. If you are not in, you cant buy anything and don't see products but you still can see that this category exist!!!So is there any way to hide this category from everyone exclude that special 3d group? I just don't wan't to let to know about this category to those client who is not in this group. They can't buy but it looks not very good it they know about section they can't in. Link to comment Share on other sites More sharing options...
Patric Posted August 24, 2009 Share Posted August 24, 2009 Topic moved. Link to comment Share on other sites More sharing options...
ningu Posted August 24, 2009 Share Posted August 24, 2009 You have to configure :- for each categroy, which group are allowed to see it (and its related products)- for each customer, to which group he belong. Especially, customers belong to default group by default. Link to comment Share on other sites More sharing options...
nimuravka Posted August 24, 2009 Share Posted August 24, 2009 yes, that is what i didevery caterory checked to be open for all necessary groupsbut even if i'm not logged in i can see link to category for special group. i cant see it's products, i cant order anything from this category but i can see that this category exists. Link to comment Share on other sites More sharing options...
first1 Posted August 26, 2009 Author Share Posted August 26, 2009 I am still now able to get the result that i need.Category1 (includes product1 = £1000) Category2 (includes product2 = £1000) Group1 (includes customer1 only) 50% discountGroup2 (includes customer2 only) 30% discountGroup3 (the default group for all other client with 0% discountI want:Customer1 to buy from category 1 with 50%discount and from category2 with 0%discountCustomer2 to buy from category 2 with 50%discount and from category1 with 0%discountOnline customers of the default group only to have 0% discount on everything.How can i achieve this ?I tried many different combinations but still cannnot find the right way of doing it.can someone please post a solution? Link to comment Share on other sites More sharing options...
first1 Posted August 28, 2009 Author Share Posted August 28, 2009 any answers? Link to comment Share on other sites More sharing options...
Nokall Posted December 3, 2009 Share Posted December 3, 2009 This is only possible when in backoffice can remove costumer from defaul Public group Because if you create retail group 20% and creat for category ipods 10% Discount it´s made by retail group 20% because can´t remove costumer from public group and give acess only to categorie ipod Link to comment Share on other sites More sharing options...
gemmo Posted January 30, 2010 Share Posted January 30, 2010 I have been asking myself this question but in the swedish part of this forum... since my skills in mysql is not the best i was thinking about modifying the call to the database in blockcategories.php when building the block categories.... my idea is that only show the categories that has been assigned to certain groups like first1 is talking about... i was thinking in my case since i will only have default users and retailers (retail group)... since assigned id_group for a retailer would be group 2 (retail)... quick check to get select(MAX(id_group)) from customer_group WHERE id_customer=$id_customer BUT i have no idea how to put this in the sql-query... it would solve my problem if the query checks the highest value assigned to the id_group for the particular customer... if customer only has id_group=1 then show default, but if customer nr 2 also has id_group=2 (retail) then show only categories/products assigned with id_group(retail)...anyone understanding what i am looking for here?thanks Link to comment Share on other sites More sharing options...
supzeb Posted April 13, 2010 Share Posted April 13, 2010 yes, that is what i didevery caterory checked to be open for all necessary groupsbut even if i'm not logged in i can see link to category for special group. i cant see it's products, i cant order anything from this category but i can see that this category exists. I would also like to know if there's a solution to this problem.I don't want restricted categories' names to be visible to all.The names are visible inside categories' page when I'm dealing with subcategories restrictions. Link to comment Share on other sites More sharing options...
first1 Posted July 5, 2010 Author Share Posted July 5, 2010 try on a test server first and do a back up. you need to implement a function and call it everytime you check for access:1)create another field in the mysql database, table ps_category_group:I called itgr_cat_red it is a decimal(10,2)this field would tell the system, the group category reduction (gr_cat_red) of each group and each category.in this field you will need to put the reduction discount i.e. 55.7% for cat 11, group 32) in classes/Category.phpadd this fuction: public function checkCategoryRed($id_customer,$id_category_default,$id_group) { if (!$id_customer) { $result = Db::getInstance()->getRow(' SELECT ctg.gr_cat_red AS reduction FROM '._DB_PREFIX_.'category_group ctg WHERE ctg.id_category = '.$id_category_default.' AND ctg.id_group = 1') ; } else { $result = Db::getInstance()->getRow(' SELECT ctg.`gr_cat_red` AS reduction FROM '._DB_PREFIX_.'category_group ctg INNER JOIN '._DB_PREFIX_.'customer_group cg on cg.`id_customer` = '.$id_customer.' AND ctg.`id_group` = '.$id_group.' WHERE ctg.`id_category` = '.$id_category_default ); } return $result['reduction']; } call this fuction anytime you want to check for access. Link to comment Share on other sites More sharing options...
supzeb Posted July 6, 2010 Share Posted July 6, 2010 Hi first1Thanks for answering. By that time I've kind of given up trying to fix that. But your solution might certainly help others. Link to comment Share on other sites More sharing options...
MEG Venture Posted July 6, 2010 Share Posted July 6, 2010 Dear First1,I couldn't get it. How will I be able to restrict a group from accessing a category using this function? What do you mean by checking for access?Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now