Skip Payment Method for Roles
Skip payment for selected WooCommerce customer roles, require an invoice upload at checkout, and assign a custom order status per role.
by Muhammad Jawad Arshad · github.com/muhammad-jawad/skip-payment-method-for-roles · website
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/muhammad-jawad/skip-payment-method-for-roles/archive/refs/heads/main.zipReadme
Skip Payment Method for Roles
A professional WooCommerce plugin that allows selected user roles to place orders without online payment, upload an invoice at checkout, and automatically assign a custom order status.
This plugin is designed for trade, distributor, wholesale, or account customers where checkout should work like a normal WooCommerce order flow, but payment is skipped for selected roles.
Features
- Assign role-based checkout rules from the WooCommerce admin
- Require invoice upload at checkout for selected roles
- Use a dedicated no-payment WooCommerce gateway for configured roles
- Apply a custom WooCommerce order status per role
- Set custom badge background and text colours for each custom status
- Change the checkout button text per role
- Support multiple roles with different rules
- Store uploaded invoice against the order
- Remove the “Pay” action for these orders in My Account
- Compatible with WooCommerce HPOS
Use Cases
This plugin is useful for businesses that need a manual review or invoice-based order process for certain customer types, such as:
- Distributors
- Trade customers
- Wholesale users
- Internal account customers
- B2B customers with payment on account
Requirements
- WordPress 6.4 or higher
- PHP 7.4 or higher
- WooCommerce 7.8 or higher
Installation
-
Upload the plugin folder to:
wp-content/plugins/skip-payment-method-for-roles -
Activate the plugin in Plugins.
-
Make sure WooCommerce is installed and active.
-
Go to:
WooCommerce → Skip Payment by Role
Configuration
Global Settings
You can configure:
-
Allowed invoice file types
Example:pdf,jpg,jpeg,png,doc,docx -
Maximum file size (MB)
Role Rules
Each role rule includes:
-
Enable
Turn the rule on or off -
User role
The WordPress role the rule applies to -
Checkout button text
Custom button text shown at checkout for that role -
Invoice field label
Custom label for the upload field -
Invoice required
Require the customer to upload an invoice before placing the order -
Status slug
Internal WooCommerce status slug, for example:distributor-review -
Status label
Human-readable status label, for example:Distributor Review -
Status Background colour
Badge background colour for the custom order status in admin -
Status colour
Badge text colour for the custom order status in admin
How It Works
For Matching Roles
When a logged-in user matches an enabled role rule:
- A custom invoice upload field is shown on checkout
- The uploaded invoice is stored before the final order submit
- Only the plugin’s custom no-payment gateway is available
- The order is placed without online payment
- A custom order status is assigned
- The uploaded invoice is attached to the order
- The cart is cleared normally
- The customer is redirected to the normal WooCommerce thank you page
For Other Roles
Users who do not match a configured rule will continue through the standard WooCommerce checkout flow.
Order Status Styling
The plugin supports custom colours for each status badge shown in WooCommerce admin.
You can configure:
- background colour
- text colour
This makes it easier for store admins to quickly identify different role-based order types.
Uploaded Invoice Handling
The uploaded invoice is:
- uploaded asynchronously before order placement
- temporarily linked to the logged-in user during checkout
- attached to the final order after successful submission
- shown in the admin order details section
If the customer removes the file before placing the order, the temporary upload is deleted.
Admin Order Details
For role-based no-payment orders, the order admin screen shows:
- customer role
- uploaded invoice file link
My Account Behaviour
For orders created through this plugin:
- the standard WooCommerce “Pay” action is removed
- the order behaves as a manual-review or invoice-submitted order
Developer Notes
Main Concepts
This plugin uses:
- a role-based rule system stored in WordPress options
- a custom WooCommerce payment gateway
- asynchronous invoice upload through AJAX
- temporary upload tracking using user meta
- custom WooCommerce order statuses
- admin CSS output for custom status badge colours
Important Architecture Notes
This plugin intentionally uses a proper WooCommerce gateway instead of forcing checkout to bypass payment with non-standard hacks.
That ensures:
- normal WooCommerce order creation
- normal thank you redirect
- normal cart clearing
- predictable status flow
- better compatibility with WooCommerce checkout logic
File Structure
skip-payment-method-for-roles/
├── skip-payment-method-for-roles.php
├── includes/
│ └── class-spmfr-gateway.php
└── assets/
├── admin.js
└── checkout.js