• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Checkout
  • Cart
  • Videos

Product Category Purchasable For Specific User Role Only

$75.00

Category: WooCommerce Tags: has_term, woocommerce_is_purchasable, wp_get_current_user
  • Description

This code enables you to control which user roles can purchase products from specific product categories. If the user role & product category are not included, the add to cart button is removed from all page types. Product from all other categories are available for purchase by default.

Product Category Not Purchasable For This User Roles
Product Category Not Purchasable For This User Roles
Product Category Purchasable For This User Role Only
Product Category Purchasable For This User Role Only

What’s Included

  1. 1 year code updates
  2. Free installation & setup for absolute beginners
  3. A custom function for WooCommerce which works with any WordPress theme.
  4. Add your role or a comma separated list of roles to line 13
  5. Add your category or comma separated categories to line 15

Installation

Copy & paste the PHP code from functions.php to the end of your child themes or custom functionality plugin and add your role(s) and category slug(s) to the code.

Primary Sidebar

Cart

Code written by Brad Dalton specialist for WooCommerce with more than 10 years of experience.

Advertise · WPEngine · Genesis · Log in

  • Code Snippets
  • Tutorials
  • Videos
  • Account
  • Checkout
  • Cart
 

Loading Comments...
 

You must be logged in to post a comment.