Giter Site home page Giter Site logo

price-by-user-role-for-woocommerce's Issues

Add tracking data in plugin: Settings, admin choice and data tracking

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

The shop page is loading very slowly with our plugin as active.

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

Price filtering is not working when different price is set for the different user roles.

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:

  1. As an Admin: https://prnt.sc/ri6ysr
  2. As Guest: https://www.screencast.com/t/w1GA5Wawze

Ticket Link: https://tychesoftwares.freshdesk.com/a/tickets/14761

Product Price by User Roles: per product feature is not working and the console shows some error.

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:

  1. Take the latest git copy
  2. Enabled Enable per product settings. https://www.screencast.com/t/IjIzB8cHm2P
  3. Go to edit product page, try to enabled per product feature.
  4. Plugin does not allow me to enabled per product option and console shows some error
    see the video : https://www.screencast.com/t/8toDg0Xtm9

Expected behavior
The plugin should allow to enabled Per product settings and the console does not show any error which comes from our plugin.

Getting a critical error on the "Multipliers" & "Per Product" tabs from our plugin.

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.

  1. Go to the "Multipliers" & "Per Product" tabs of our plugin and you will get a message "There has been a critical error on this website. Please check your site admin email inbox for instructions." there.
  2. This error is coming at WC -> Status -> Logs
    [21-Sep-2022 07:06:03 UTC] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /is/htdocs/wp12357911_HH4C4GMTV8/www/shop.nospamproxy.de/testshop-nsp/wp-content/plugins/price-by-user-role-for-woocommerce/includes/settings/class-alg-wc-price-by-user-role-settings-multipliers.php:84
    Stack trace:
    #0 /is/htdocs/wp12357911_HH4C4GMTV8/www/shop.nospamproxy.de/testshop-nsp/wp-content/plugins/price-by-user-role-for-woocommerce/includes/settings/class-alg-wc-price-by-user-role-settings-section.php(57): Alg_WC_Price_By_User_Role_Settings_Multipliers->get_section_settings()
    #1 /is/htdocs/wp12357911_HH4C4GMTV8/www/shop.nospamproxy.de/testshop-nsp/wp-includes/class-wp-hook.php(307): Alg_WC_Price_By_User_Role_Settings_Section->get_settings(Array)
    #2 /is/htdocs/wp12357911_HH4C4GMTV8/www/shop.nospamproxy.de/testshop-nsp/wp-includes/plugin.php(191): WP_Hook->apply_filters(Array, Array)
    #3 /is/htdocs/wp12357911_HH4C4GMTV8/www/shop.nospamproxy.de/testshop-nsp/wp-content/plugins/price-by-user-role-for-woocommerce/includes/settings/class-alg-wc-settings-price-by-user-role.php(45): apply_filters('woocommerce_get...', Array)
    #4 /is/htdocs/wp12357911_HH4C4GMTV8/www/shop.nospamproxy.de/testshop-nsp/wp-content/plugins/woocommerce/includes/admin/settings/class-wc-settings-page.php(211): Alg_WC_Settings_Price_By_User_Role->get_settings('multipliers')
    #5 /is/htdocs/wp12357911_HH4C4GMTV8/www/shop.nospamproxy.de/testshop-nsp/wp-includes/class-wp-hook.php(307): WC_Settings_Page->output('')
    #6 /is/htdocs/wp12357911_HH4C4GMTV8/www/shop.nospamproxy.de/testshop-nsp/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
    #7 /is/htdocs/wp12357911_HH4C4GMTV8/www/shop.nospamproxy.de/testshop-nsp/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
    #8 /is/htdocs/wp12357911_HH4C4GMTV8/www/shop.nospamproxy.de/testshop-nsp/wp-content/plugins/woocommerce/includes/admin/views/html-admin-settings.php(40): do_action('woocommerce_set...')
    #9 /is/htdocs/wp12357911_HH4C4GMTV8/www/shop.nospamproxy.de/testshop-nsp/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-settings.php(154): include('/is/htdocs/wp12...')
    #10 /is/htdocs/wp12357911_HH4C4GMTV8/www/shop.nospamproxy.de/testshop-nsp/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-menus.php(286): WC_Admin_Settings::output()
    #11 /is/htdocs/wp12357911_HH4C4GMTV8/www/shop.nospamproxy.de/testshop-nsp/wp-includes/class-wp-hook.php(307): WC_Admin_Menus->settings_page('')
    #12 /is/htdocs/wp12357911_HH4C4GMTV8/www/shop.nospamproxy.de/testshop-nsp/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
    #13 /is/htdocs/wp12357911_HH4C4GMTV8/www/shop.nospamproxy.de/testshop-nsp/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
    #14 /is/htdocs/wp12357911_HH4C4GMTV8/www/shop.nospamproxy.de/testshop-nsp/wp-admin/admin.php(259): do_action('woocommerce_pag...')
    #15 {main}
    thrown in /is/htdocs/wp12357911_HH4C4GMTV8/www/shop.nospamproxy.de/testshop-nsp/wp-content/plugins/price-by-user-role-for-woocommerce/includes/settings/class-alg-wc-price-by-user-role-settings-multipliers.php on line 84

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

Html is being displayed instead of link

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

Some deprecated warnings appear with PHP 8.2

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.

Below warnings are displaying on the plugin's tabs.

Describe the bug
Below warnings are displaying on the plugin's tabs.

  1. 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

  2. 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:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

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

Debug log error found while doing quick testing.

Describe the bug
Debug log error found while doing quick testing.

To Reproduce
Steps to reproduce the behavior:

  1. WP 5.8 installation
  2. WC v.5.5.1
  3. I did quick testing and I got the below debug log error.

[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 price set for the user role is not being considered when the order is creating manually by the site admin.

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:

  1. Create a user role for "Guest" and set the price to $400. The product price is set at $500.
  2. Create a WooCommerce order for that product for a guest user from the admin dashboard backend.
  3. Here, you will notice that the price set for the guest user role is not being considered. Instead, the system considers the regular price of the product.
  4. If a guest user places an order from the frontend, the user role price is considered correctly.

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

Option to select the Price as per user role for the orders created manually.

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/

The 'Price by User Role' fields should be shown using the Ajax when the 'Enabled' dropdown is set to 'Yes' otherwise hidden.

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

Fix the error from the "alg-wc-price-by-user-role-functions.php" file.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.