WP Manifestindependent plugin directory
manifest / ecommerce / wc-zero-price-roles

WooCommerce Zero Price for Roles

Allow specific customer roles to buy products with price = 0

by Binjuhor · github.com/binjuhor/wc-zero-price-roles · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/binjuhor/wc-zero-price-roles/archive/refs/heads/main.zip

Readme

WooCommerce Zero Price for Roles

A WordPress plugin that allows specific customer roles to purchase WooCommerce products at zero cost while maintaining original prices for other users.

Description

This plugin enables store administrators to configure specific user roles that can purchase any product for free. The plugin dynamically changes product prices to $0.00 for selected user roles while preserving the original pricing for all other customers.

Features

  • Role-Based Pricing: Configure which user roles can purchase products for free
  • Real-Time Price Updates: Prices update dynamically based on user role
  • Admin Interface: Easy-to-use settings page integrated with WooCommerce
  • Variable Product Support: Works with simple and variable products
  • Cache Compatible: Proper cache handling for price changes
  • WooCommerce Compatible: Fully compatible with WooCommerce features including HPOS and Cart & Checkout Blocks

Requirements

  • WordPress 5.0 or higher
  • WooCommerce 5.0 or higher
  • PHP 8.0 or higher

Installation

Method 1: Manual Installation

  1. Download the Plugin

    # If you have the plugin files, compress them into a zip
    cd wp-content/plugins/
    zip -r wc-zero-price-roles.zip wc-zero-price-roles/
  2. Upload via WordPress Admin

    • Go to your WordPress admin dashboard
    • Navigate to Plugins > Add New
    • Click Upload Plugin
    • Choose the wc-zero-price-roles.zip file
    • Click Install Now
    • Click Activate Plugin

Method 2: FTP Installation

  1. Upload Files

    • Download/copy the plugin folder wc-zero-price-roles
    • Upload it to /wp-content/plugins/ directory via FTP
    • The final path should be: /wp-content/plugins/wc-zero-price-roles/
  2. Activate Plugin

    • Go to WordPress admin dashboard
    • Navigate to Plugins > Installed Plugins
    • Find "WooCommerce Zero Price for Roles"
    • Click Activate

Method 3: WP-CLI Installation (for developers)

# Navigate to your WordPress root directory
cd /path/to/your/wordpress/

# Copy plugin to plugins directory (if not already there)
# Activate the plugin
wp plugin activate wc-zero-price-roles

Configuration

  1. Access Settings

    • Go to WooCommerce > Zero Price Roles in your WordPress admin
  2. Select User Roles

    • Check the boxes for user roles that should see products as free
    • Available roles typically include:
      • Administrator
      • Editor
      • Author
      • Contributor
      • Subscriber
      • Customer (WooCommerce)
      • Shop Manager (WooCommerce)
      • Any custom roles created by other plugins
  3. Save Settings

    • Click Save Changes to apply the configuration

How It Works

  1. For Selected Roles: Users with selected roles will see all product prices as $0.00 and can complete purchases without payment
  2. For Other Users: Users with non-selected roles see normal product prices and must pay as usual
  3. Real-Time Updates: Price changes are immediate and respect WooCommerce caching

Usage Examples

Example 1: Free Products for VIP Customers

  • Create a custom "VIP" user role
  • Select "VIP" in the plugin settings
  • VIP customers can purchase any product for free

Example 2: Employee Discounts

  • Select "Employee" role (custom role)
  • All employees can purchase products at zero cost
  • Regular customers still pay full price

Example 3: Beta Testing

  • Select "Subscriber" role for beta testers
  • Allow subscribers to test products for free
  • Maintain normal pricing for paying customers

Frequently Asked Questions

Q: Does this work with variable products?

A: Yes, the plugin supports both simple and variable products.

Q: Will this affect my existing orders?

A: No, the plugin only affects new purchases. Existing orders remain unchanged.

Q: Can I exclude specific products?

A: Currently, the plugin applies to all products. Product-specific exclusions may be added in future versions.

Q: Does this work with other discount plugins?

A: The plugin sets prices to $0 for selected roles, which may override other discount plugins for those users.

Q: Is this compatible with WooCommerce subscriptions?

A: Basic compatibility exists, but full subscription features haven't been extensively tested.

Support

For support, please:

  1. Check the FAQ section above
  2. Review WooCommerce and WordPress logs for errors
  3. Ensure WooCommerce is up to date
  4. Test with default WordPress theme to rule out theme conflicts

Changelog

Version 1.0.0

  • Initial release
  • Role-based zero pricing functionality
  • Admin settings interface
  • WooCommerce compatibility declarations
  • Variable product support
  • Cache handling

License

This plugin is licensed under the GPL v2 or later.

Credits

Developed by Binjuhor


Note: Always test plugins on a staging site before deploying to production. This plugin modifies pricing functionality which directly affects your store's revenue.

Read the full README on GitHub →