{"id":3909,"date":"2024-12-15T10:47:21","date_gmt":"2024-12-15T10:47:21","guid":{"rendered":"https:\/\/ithemelandco.com\/docs\/woorbp\/?p=3909"},"modified":"2024-12-16T07:22:28","modified_gmt":"2024-12-16T07:22:28","slug":"hide-add-to-cart-button-for-user-role","status":"publish","type":"post","link":"https:\/\/ithemelandco.com\/docs\/woorbp\/hide-add-to-cart-button-for-user-role\/","title":{"rendered":"How to hide the add-to-cart button for special user roles?"},"content":{"rendered":"\n

If you want to prevent some users from ordering products directly from your site, it is very important to hide the add to cart button on the product page and archive page for those specific users. <\/p>\n\n\n\n

You have no option in WooCommerce to make this happen, so, in the following, we want to show you how to hide the add-to-cart button for a particular user role in the WooCommerce Role Based Pricing plugin<\/span><\/a>.<\/p>\n\n\n\n

Hide add to cart button for special user roles<\/h2>\n\n\n\n

To hide the add-to-cart button for special user roles using the WooCommerce role-based pricing plugin follow these steps:<\/p>\n\n\n\n

    \n
  1. Go to the iThemeland<\/strong> -> Role Based Pricing<\/strong>.<\/li>\n\n\n\n
  2. Go to the Hide price<\/strong> tab.<\/li>\n\n\n\n
  3. Mark Enable Hide Price & Add to Cart<\/strong> button<\/strong> field.<\/li>\n\n\n\n
  4. Mark Hide for Registered users<\/strong> then open the drop-down list of Select User Roles<\/strong> and choose the specific user roles from the list. All user roles that you have defined in WordPress will be automatically displayed to you in this list. So, you can add as many user roles as you need.<\/li>\n\n\n\n
  5. Mark Hide add to cart button<\/strong> to prevent showing the add to cart button on the WooCommerce archive and product page. You can also set the following fields:\n