tychesoftwares / price-by-user-role-for-woocommerce Goto Github PK
View Code? Open in Web Editor NEWRepository for Price by User Roles for WooCommerce - Lite
Repository for Price by User Roles for WooCommerce - Lite
=== Product Prices by User Roles for WooCommerce === Contributors: tychesoftwares Tags: woocommerce, price by user role, role based pricing, user role Requires at least: 4.4 Tested up to: 6.5.0 Stable tag: trunk Requires PHP: 7.4 License: GNU General Public License v3.0 License URI: http://www.gnu.org/licenses/gpl-3.0.html Display WooCommerce products prices by user roles. == Description == **[Product Prices by User Roles for WooCommerce](https://woocommerce.com/products/product-prices-by-user-roles-for-woocommerce/)** plugin lets you display WooCommerce products prices by user roles. Prices can be set **globally** or on **per product** basis. When setting prices **globally**, you just need to set price multiplier for each user role. When setting prices **per product** basis, you can set exact price for each product. Works with variable products. You can also **hide product prices** for selected user roles. **Some of our Pro plugins:** 1. **[Abandoned Cart Pro for WooCommerce](https://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro/?utm_source=wprepo&utm_medium=link&utm_campaign=PriceByUserRole "Abandoned Cart Pro for WooCommerce")** 2. **[Booking & Appointment Plugin for WooCommerce](https://www.tychesoftwares.com/store/premium-plugins/woocommerce-booking-plugin/?utm_source=wprepo&utm_medium=link&utm_campaign=PriceByUserRole "Booking & Appointment Plugin for WooCommerce")** 3. **[Order Delivery Date Pro for WooCommerce](https://www.tychesoftwares.com/store/premium-plugins/order-delivery-date-for-woocommerce-pro-21/?utm_source=wprepo&utm_medium=link&utm_campaign=PriceByUserRole "Order Delivery Date Pro for WooCommerce")** 4. **[Product Delivery Date Pro for WooCommerce](https://www.tychesoftwares.com/store/premium-plugins/product-delivery-date-pro-for-woocommerce/?utm_source=wprepo&utm_medium=link&utm_campaign=PriceByUserRole "Product Delivery Date Pro for WooCommerce")** 5. **[Deposits For WooCommerce](https://www.tychesoftwares.com/store/premium-plugins/deposits-for-woocommerce/?utm_source=wprepo&utm_medium=link&utm_campaign=PriceByUserRole "Deposits For WooCommerce")** 6. **[Payment Gateway Based Fees and Discounts for WooCommerce - Pro](https://www.tychesoftwares.com/store/premium-plugins/payment-gateway-based-fees-and-discounts-for-woocommerce-plugin/?utm_source=wprepo&utm_medium=link&utm_campaign=PriceByUserRole "Payment Gateway Based Fees and Discounts for WooCommerce - Pro")** 7. **[Custom Order Status for WooCommerce - Pro](https://www.tychesoftwares.com/store/premium-plugins/custom-order-status-woocommerce/?utm_source=wprepo&utm_medium=link&utm_campaign=PriceByUserRole "Custom Order Status for WooCommerce - Pro")** 8. **[Custom Order Numbers for WooCommerce - Pro](https://www.tychesoftwares.com/store/premium-plugins/custom-order-numbers-woocommerce/?utm_source=wprepo&utm_medium=link&utm_campaign=PriceByUserRole "Custom Order Numbers for WooCommerce - Pro")** 9. **[Product Input Fields for WooCommerce - Pro](https://www.tychesoftwares.com/store/premium-plugins/product-input-fields-for-woocommerce/?utm_source=wprepo&utm_medium=link&utm_campaign=PriceByUserRole "Product Input Fields for WooCommerce - Pro")** 10. **[Call for Price for WooCommerce - Pro](https://www.tychesoftwares.com/store/premium-plugins/woocommerce-call-for-price-plugin/?utm_source=wprepo&utm_medium=link&utm_campaign=PriceByUserRole "Call for Price for WooCommerce - Pro")** 11. **[Currency per Product for WooCommerce - Pro](https://www.tychesoftwares.com/store/premium-plugins/currency-per-product-for-woocommerce/?utm_source=wprepo&utm_medium=link&utm_campaign=PriceByUserRole "Currency per Product for WooCommerce - Pro")** **Some of our other free plugins:** 1. **[Abandoned Cart for WooCommerce](https://wordpress.org/plugins/woocommerce-abandoned-cart/ "Abandoned Cart for WooCommerce")** 2. **[Order Delivery Date for WooCommerce - Lite](https://wordpress.org/plugins/order-delivery-date-for-woocommerce/ "Order Delivery Date for WooCommerce - Lite")** 3. **[Product Delivery Date for WooCommerce - Lite](https://wordpress.org/plugins/product-delivery-date-for-woocommerce-lite/ "Product Delivery Date for WooCommerce")** 4. **[Payment Gateway Based Fees and Discounts for WooCommerce](https://wordpress.org/plugins/checkout-fees-for-woocommerce/ "Payment Gateway Based Fees and Discounts for WooCommerce")** 5. **[Custom Order Status for WooCommerce](https://wordpress.org/plugins/custom-order-statuses-woocommerce/ "Custom Order Status for WooCommerce")** 6. **[Custom Order Numbers for WooCommerce](https://wordpress.org/plugins/custom-order-numbers-for-woocommerce/ "Custom Order Numbers for WooCommerce")** 7. **[Product Input Fields for WooCommerce](https://wordpress.org/plugins/product-input-fields-for-woocommerce/ "Product Input Fields for WooCommerce")** 8. **[Call for Price for WooCommerce](https://wordpress.org/plugins/woocommerce-call-for-price/ "Call for Price for WooCommerce")** 9. **[Currency per Product for WooCommerce](https://wordpress.org/plugins/currency-per-product-for-woocommerce/ "Currency per Product for WooCommerce")** = Feedback = * We are open to your suggestions and feedback. Thank you for using or trying out one of our plugins! = More = * Visit the **[Product Prices by User Roles for WooCommerce plugin page](https://woocommerce.com/products/product-prices-by-user-roles-for-woocommerce/)**. == Installation == 1. Upload the entire plugin folder to the `/wp-content/plugins/` directory. 2. Activate the plugin through the "Plugins" menu in WordPress. 3. Start by visiting plugin settings at "WooCommerce > Settings > Product Prices by User Role". == Changelog == = 1.9.0 - 03/04/2024 = * Tweak - Update compatibility with WordPress 6.5. * Tweak - Update compatibility with WooCommerce 8.7. * Fix – Cross Site Request Forgery (CSRF) vulnerability. = 1.8.0 - 13/02/2024 = * Fix - Fixed Cross Site Request Forgery (CSRF) vulnerability. = 1.7.0 - 18/07/2023 = * Enhancement - Added deactivation survey v2. * Fix - Warning errors displayed on the plugin's tab when the WPBakery Page Builder plugin is activated. * Fix - Compatibility with PHP 8.1.12. * Fix - Fixed PHP warnings reported in debug log. = 1.6.0 - 24/01/2022 = * Enhancement - Add Option to select the Price as per user role for the orders created manually. * Fix - Fatal error on the "Multipliers" & "Per Product" tabs. = 1.5.0 - 15/11/2022 = * Enhancement - Introduced compatibility with WooCommerce High Performance Order Storage. = 1.4.3 - 24/05/2021 = * Tweak - Now shop manager role will be able to edit the product prices for all the user roles. * Fix - Price filtering widget was not working on shop page when different price was set for the different user roles. This is fixed now. = 1.4.2 - 10/06/2020 = * Update compatibility with WooCommerce 4.2. * Plugin name changed to Product Prices by User Roles for WooCommerce. = 1.4.1 - 20/03/2020 = * Update compatibility with WooCommerce 4.0.0. = 1.4 - 24/08/2019 = * Changes in code to make the plugin compliant as per WPCS rules. = 1.3 - 13/05/2019 = * Tweak - Modified the code to load the roles and prices for per product settings using jQuery instead of forcing a page reload. * Fix - Added the uninstall.php file to ensure plugin cleans up its records when deleted. = 1.2.2 - 16/11/2018 * Author name and URL updated due to handover of the plugins = 1.2.1 - 31/10/2018 = * Compatibility with WooCommerce 3.5.0 tested. = 1.2.0 - 09/09/2018 = * Dev - Per Product - Listing all variations for variable products (instead of "available" only). * Dev - Code refactoring: `version_updated()` function added; autoloading plugin options; settings are saved as main class property; `admin` folder renamed etc. * Dev - Admin setting descriptions updated. Minor meta box restyling. Outputting tooltip with `wc_help_tip()`. * Dev - Plugin URI updated. = 1.1.1 - 09/06/2018 = * Dev - Plugin renamed to "Price based on User Role for WooCommerce" from "Price by User Role for WooCommerce". = 1.1.0 - 12/05/2017 = * Dev - WooCommerce 3.x.x compatibility - `get_formatted_variation_attributes()`. * Dev - WooCommerce 3.x.x compatibility - Product ID. * Dev - WooCommerce 3.x.x compatibility - Price hooks. * Fix - `woocommerce_variation_prices_sale_price` hook fixed. * Dev - Code refactoring - `alg_get_product_display_price()`. * Dev - Code refactoring - Price hooks. * Tweak - Plugin header (Text Domain etc.) updated. * Tweak - Plugin link changed from `http://coder.fm` to `https://wpcodefactory.com`. = 1.0.0 - 27/01/2017 = * Initial Release. == Upgrade Notice == = 1.0.0 = This is the first release of the plugin.
The client wants to show the price of more than one user role on the frontend.
Currently, we do show only the particular user role price.
Ticket link: https://tychesoftwares.freshdesk.com/a/tickets/17876
Able to allow the shop manager user role to edit the prices for all the added user role just same like admin user role is able to do it.
Ticket: https://tychesoftwares.freshdesk.com/a/tickets/8889
The enhancement is already done for pro plugin: https://github.com/TycheSoftwares/price-by-user-role-for-woocommerce-pro/commit/2e45ca66fce86a8ed7b6ec03a85a5830465eebfd
Describe the bug
Getting the below critical error on the "Multipliers" & "Per Product" tabs from our plugin.
To Reproduce
Steps to reproduce the behavior:
WordPress & WooCommerce version are latest.
PHP version 8.0.23 is present on the client site.
NOTE: I tried to replicate this error on my local where the PHP 8.0.0 is present but I am unable to replicate this error there.
Expected behavior
Such an error should not appear from our plugin.
Screenshots
https://www.screencast.com/t/3UcrRhT5R
Additional context
https://tychesoftwares.freshdesk.com/a/tickets/44811
Describe the bug
The shop page is loading very slowly with our plugin as active. When we deactivate our plugin, the shop page starts loading fast.
To Reproduce
Steps to reproduce the behavior:
Note: I am able to replicate this issue only on a client's site, not on our staging site.
Expected behavior
The shop page should be loaded fast with our plugin as active.
Video
https://www.screencast.com/t/3udXZ3jx
Additional context
https://tychesoftwares.freshdesk.com/a/tickets/39213
The client wants to add the extra price fields for the particular user role, not just the base ones. Currently, we have only the regular price and the sale price option.
Link: https://wordpress.org/support/topic/anyway-to-show-up-another-price-field/
Is your feature request related to a problem? Please describe.
Client Response:
I noticed that when I create a product and I switch the dropdown from "Enabled: Off" to "Enabled: On" the fields (Price by User Role)) doesn't drop down until I update it. This is annoying to do, can this be fixed?
Describe the solution you'd like
Yes I would change that to load the fields when the dropdown is set to yes and then hide them when the option is set to no. You can do that with AJAX to load it when the options change.
Additional context
Screenshot of the Product page: https://prnt.sc/mf2xek
Describe the bug
Fix the below error from the "alg-wc-price-by-user-role-functions.php" file. This issue is responsible for not presenting any user role in the "Per product" options.
To Reproduce
Steps to reproduce the behavior:
One client has mentioned this bug with the below details:
Error is at line 137 of includes/alg-wc-price-by-user-role-functions.php.
You use the variable $role_data that does not exist and it is confused with $_role from the foreach.
if ( ! function_exists( 'alg_get_user_roles_options' ) ) { /** * Alg_get_user_roles_options. * * @version 1.0.0 * @since 1.0.0 */ function alg_get_user_roles_options() { $all_roles = alg_get_user_roles(); $all_roles_options = array(); foreach ( $all_roles as $_role_key => $_role ) { if ( ! empty( $role_data['name'] ) ) { $all_roles_options[ $_role_key ] = $_role['name']; } } return $all_roles_options; } }
Additional context
https://tychesoftwares.freshdesk.com/a/tickets/49840
When I am trying to enable price by role for more than one product then an error notice is being displayed which is correct but inside that notice, instead of the link of the pro version, HTML is being displayed. Also, the link is of wpfactory and not of our website.
Screenshot : https://prnt.sc/owudap
Describe the bug
The console shows some error on the woo_order page.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No errors must be thrown from our plugin.
When we create the order manually from the backend then the prices of the products added are taken as per the admin roles, but if one wants to create the order and take the prices as per the different roles then it is not possible to do that.
So suppose, there is Product A and in that price for Customer is set as 100 and Admin Price is set to 50
now when the admin creates an order manually for his client (who is a customer) he wants the Price of the Product to be 100 and not 50. so there should be an option to select the prices as per user roles for the products added for that order.
Ticket:- https://tychesoftwares.freshdesk.com/a/tickets/26635
https://wordpress.org/support/topic/prices-per-role-for-orders-created-from-back-office/
Describe the bug
Add the data tracking code in the plugin to ensure all the relevant details (global settings, product settings etc.) are sent back to the tracking server.
This exercise is needed to ensure we're collecting all the relevant data (with regards to the all features added ) and utilizing the data to its fullest potential.
Additional context
https://docs.google.com/document/d/1T-4QcwvO1K-dZLFQwOxC_xvPjX4QFFXuSqt1bNn7lU4/edit
Describe the bug
Some deprecated warnings appear with PHP 8.2
Deprecate Creation of dynamic property Alg_WC_Price_By_User_Role::$settings is deprecated
wp-content/plugins/price-by-user-role-for-woocommerce/price-by-user-role-for-woocommerce.php:107
Deprecated Creation of dynamic property Alg_WC_Price_By_User_Role_Settings_General::$id is deprecated
wp-content/plugins/price-by-user-role-for-woocommerce/includes/settings/class-alg-wc-price-by-user-role-settings-general.php:33
Deprecated Creation of dynamic property Alg_WC_Price_By_User_Role_Settings_General::$desc is deprecated
wp-content/plugins/price-by-user-role-for-woocommerce/includes/settings/class-alg-wc-price-by-user-role-settings-general.php:34
Deprecated Creation of dynamic property Alg_WC_Price_By_User_Role_Settings_Multipliers::$id is deprecated
wp-content/plugins/price-by-user-role-for-woocommerce/includes/settings/class-alg-wc-price-by-user-role-settings-multipliers.php:33
Deprecated Creation of dynamic property Alg_WC_Price_By_User_Role_Settings_Multipliers::$desc is deprecated
wp-content/plugins/price-by-user-role-for-woocommerce/includes/settings/class-alg-wc-price-by-user-role-settings-multipliers.php:34
Deprecated Creation of dynamic property Alg_WC_Price_By_User_Role_Settings_Per_Product::$id is deprecated
wp-content/plugins/price-by-user-role-for-woocommerce/includes/settings/class-alg-wc-price-by-user-role-settings-per-product.php:33
Deprecated Creation of dynamic property Alg_WC_Price_By_User_Role_Settings_Per_Product::$desc is deprecated
wp-content/plugins/price-by-user-role-for-woocommerce/includes/settings/class-alg-wc-price-by-user-role-settings-per-product.php:34
Expected behavior
No error must be thrown from our plugin.
Describe the bug
There have been some updates to the Tyche JS and Plugin Deactivation repos.
Please update the v2 Plugin Deactivation files in the plugins where they have been implemented in.
Describe the bug
The price set for the user role is not being considered when the order is creating manually by the site admin. Instead of that, the regular product price is being considered.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The price set for the user role should be considered even if the order is created from the backend.
Additional Context
https://support.tychesoftwares.com/conversation/2102
Describe the bug
Product Price by User Roles: per product feature is not working and the console shows some error.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The plugin should allow to enabled Per product settings and the console does not show any error which comes from our plugin.
Describe the bug
When the plugin is deleted, the settings etc. are not deleted from the DB.
Expected behavior
The settings etc. should be deleted.
Is your feature request related to a problem? Please describe.
Add the deactivation survey v2 in the plugin.
Describe the solution you'd like
Tyche Javascript Constructor: https://github.com/TycheSoftwares/tyche-js-constructor
Plugin Deactivation: https://github.com/TycheSoftwares/tyche-plugin-deactivation
The description of the usage is in the README.md files of the respective repos.
The client has an issue where the filter of the price is not working when we set a different price for different user roles.
Suppose we have set 2 multipliers for the guest user and when we logged in as the guest user and filter the price, the price filtering is done as per the admin user role.
Screenshots:
Ticket Link: https://tychesoftwares.freshdesk.com/a/tickets/14761
Describe the bug
Debug log error found while doing quick testing.
To Reproduce
Steps to reproduce the behavior:
[19-Jul-2021 06:07:40 UTC] PHP Notice: Undefined index: alg_wc_price_by_user_role in C:\Users\User\Local Sites\orderdeliverydate\app\public\wp-content\plugins\woocommerce\packages\woocommerce-admin\includes\connect-existing-pages.php on line 89
[19-Jul-2021 06:07:40 UTC] PHP Stack trace:
[19-Jul-2021 06:07:40 UTC] PHP 1. {main}() C:\Users\User\Local Sites\orderdeliverydate\app\public\wp-admin\admin.php:0
[19-Jul-2021 06:07:40 UTC] PHP 2. require_once() C:\Users\User\Local Sites\orderdeliverydate\app\public\wp-admin\admin.php:239
[19-Jul-2021 06:07:40 UTC] PHP 3. do_action() C:\Users\User\Local Sites\orderdeliverydate\app\public\wp-admin\admin-header.php:251
[19-Jul-2021 06:07:40 UTC] PHP 4. WP_Hook->do_action() C:\Users\User\Local Sites\orderdeliverydate\app\public\wp-includes\plugin.php:470
[19-Jul-2021 06:07:40 UTC] PHP 5. WP_Hook->apply_filters() C:\Users\User\Local Sites\orderdeliverydate\app\public\wp-includes\class-wp-hook.php:327
[19-Jul-2021 06:07:40 UTC] PHP 6. Automattic\WooCommerce\Admin\Loader::embed_page_header() C:\Users\User\Local Sites\orderdeliverydate\app\public\wp-includes\class-wp-hook.php:303
[19-Jul-2021 06:07:40 UTC] PHP 7. Automattic\WooCommerce\Admin\Loader::get_embed_breadcrumbs() C:\Users\User\Local Sites\orderdeliverydate\app\public\wp-content\plugins\woocommerce\packages\woocommerce-admin\src\Loader.php:857
[19-Jul-2021 06:07:40 UTC] PHP 8. wc_admin_get_breadcrumbs() C:\Users\User\Local Sites\orderdeliverydate\app\public\wp-content\plugins\woocommerce\packages\woocommerce-admin\src\Loader.php:832
[19-Jul-2021 06:07:40 UTC] PHP 9. Automattic\WooCommerce\Admin\PageController->get_breadcrumbs() C:\Users\User\Local Sites\orderdeliverydate\app\public\wp-content\plugins\woocommerce\packages\woocommerce-admin\includes\page-controller-functions.php:62
[19-Jul-2021 06:07:40 UTC] PHP 10. apply_filters() C:\Users\User\Local Sites\orderdeliverydate\app\public\wp-content\plugins\woocommerce\packages\woocommerce-admin\src\PageController.php:149
[19-Jul-2021 06:07:40 UTC] PHP 11. WP_Hook->apply_filters() C:\Users\User\Local Sites\orderdeliverydate\app\public\wp-includes\plugin.php:189
[19-Jul-2021 06:07:40 UTC] PHP 12. wc_admin_filter_core_page_breadcrumbs() C:\Users\User\Local Sites\orderdeliverydate\app\public\wp-includes\class-wp-hook.php:305
Note: This issue is replicated only with WP 5.8 or lower version of WP
Expected behavior
No error should be captured from our plugin.
The client wants to have the feature that sets the price based on the user role and also for the particular category.
Currently, our plugin sets the price based on the user role on individual products.
Ticket link: https://tychesoftwares.freshdesk.com/a/tickets/19002
Describe the bug
Below warnings are displaying on the plugin's tabs.
on Multipliers Tab
Warning: Illegal string offset 'name' in /www/htdocs/w017a40b/humusziegel/wp-content/plugins/price-by-user-role-for-woocommerce/includes/settings/class-alg-wc-price-by-user-role-settings-multipliers.php on line 84
on Per Product Tab
Warning: Illegal string offset 'name' in /www/htdocs/w017a40b/humusziegel/wp-content/plugins/price-by-user-role-for-woocommerce/includes/alg-wc-price-by-user-role-functions.php on line 132
Also, there are only the Guest and Administrator Roles, but the third role "s" is displaying which is not there on the client site.
Note: I tried the same setup at our end but was unable to replicate these errors on my staging.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Such warnings should not display.
Screenshots
https://www.screencast.com/t/KITA6Z4TMc1
https://www.screencast.com/t/Wc23QUv0or
Additional context
https://tychesoftwares.freshdesk.com/a/tickets/33301
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.