Note:
Make sure to install WooCommerce and WooCommerce Simple Auctions before you activate plugin.
** Version 2.0 **
- Add: arrays instead of constants for easier adding of multiple roles
- Fix: notice
** Version 1.0 **
- Initial release
WooCommere Simple Auction Role Based Bidding and Payment Method Verification enables only specific roles to bid and change user role to one that can bid after purchase of specific product (usable for verifying payment method). Settings are hardcoded as constants to avoid WordPress database calls (for settings) and have low impact on performance since functions below have to be called on every place bid request.
Source: https://codex.wordpress.org/Managing_Plugins#Installing_Plugins
Make sure to install WooCommerce and WooCommerce Simple Auctions before you activate plugin.
Since settings are hardcoded you will have to edit woocommerce-wsa-roles.php file before you can use plugin. If you never edit PHP file please open support ticket and we will do setup for you. Steps for DIY setup:
Since default role set in WordPress settings is "subscriber" we will disallow this role from bidding and give user "customer" role once they purchase (verify) payment method.
Keep on your mind that WooCommerce by default gives "customer" role to a user when user registers via the checkout or signup process so you can use something like code snippet below to set "subscriber" role for WooCommerce registrations too (should be in functions.php):
// Replace 'customer' role (WooCommerce use by default) with your own one.
add_filter('woocommerce_new_customer_data', 'wc_assign_custom_role', 10, 1);
function wc_assign_custom_role($args) {
$args['role'] = 'subscriber';
return $args;
}
There is also option to create custom roles using free User Role Editor plugin. For example you can set default user role to be customer role then using User Role Editor create copy of customer role called bidder. Then just instead of subscriber set default role to be customer and bidder role will be elevated customer role which can place bids. See screenshot below:
This plugin is created by wpgenie. Check out our Envato profile where you can support us by purchasing our plugins, give us feedback and post your ideas and feature requests, ask for support and rate our items. Check out our free stuff.
We do WordPress developing, plugins for WordPress & WooCommerce, eCommerce sites based on WooCommerce, WordPress performance optimization and managed WordPress hosting.