cart functions only for specific role

I am building a new site that i need to allow ONLY wholesaler to be able to add to cart items and checkout however all other users can only view the products but not have any cart functions including not to show the add to cart button for them.
how can this be achived?
i changed the settings that all new accounts need to be approved (so i can control who is a wholesaler etc...)
please let me know.
Thank you

Posted: Mar 24, 2013


ariban99 on March 24, 2013

thank i used the field permission module which takes away the add to cart functions by role however the price is not working, it wont disappear. any ideas?

ariban99 on March 24, 2013

wow much better the database edit worked great i made teh change then i block it again in the database. much better than my solution, i reverted everything back to the above solution.

ariban99 on March 24, 2013

well what i did was i created a new text field and i edited the node.tpl file that it should show the new text field. then i took the body text field which is by default only 3 lines and i put in there a second time the price for the wholesaler (of course also in the regular price field so the system can calculate the price). then i was able to allow only authenticated users to see the "BODY text" which is the price and i hide all together the price field from being viewed. so this accomplished what i needed, as the module field permissions doesnt allow you to change the price field but it does allow you to change the body field by role permission!
thanks for the help with this module.

ariban99 on March 24, 2013

for all those who want simple instruction and not have to read one million things like i did. here you go 7 easy steps, takes a few minutes:
1. Install module field permissions
2. To unlock your price (for next step) you can go to your database -> table field_config -> edit commerce_price entry to change "locked" from 1 (enabled) to 0 (disabled)
3. Go into /admin/commerce/config/product-variation-types/product/fields/commerce_price and change that only authentic users can view price.
4. When done, go back to step 2 and put back 1 to enable the block!
5. Then to go /admin/structure/types/manage/product-display/fields/field_product this is for the add to cart button and select show only to authentic users.
6. Then go into /admin/people/permissions and select Access checkout and give permission only authentic users. (this will remove the checkout button in the cart if someone they got there)
7. Last step is to not show the cart nor its functions that are on the top right of the website and only show it to authentic users, this is a simple block to change so go to admin/structure/block/manage/views/shopping_cart-block/configure%3Fdestination%3Dnode scroll down to Roles and select the authentic and administrator roles, so only those roles will see this block.

hope this helps.

newbieuser on October 9, 2013

your step 2, do u mean actually going to the database, If yes, could u be so kind to list out the steps.
if not, it is within drupal, could u tell me how to get to database. Many thks.