• Hi there,

    We happened to be troubleshooting something else and noticed the following in our error log on our server:

    [02-Jul-2024 11:09:43 UTC] PHP Warning: Attempt to read property “wwpp_wholesale_roles” on null in /home/voltgrooming/www/wp-content/themes/volt2024/functions.php on line 194
    [02-Jul-2024 11:09:43 UTC] PHP Fatal error: Uncaught Error: Call to a member function getUserWholesaleRole() on null in /home/voltgrooming/www/wp-content/themes/volt2024/functions.php:194
    Stack trace: 0 /home/voltgrooming/www/wp-includes/class-wp-hook.php(324): {closure}() 1 /home/voltgrooming/www/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 2 /home/voltgrooming/www/wp-includes/plugin.php(565): WP_Hook->do_action() 3 /home/voltgrooming/www/wp-includes/class-wp.php(830): do_action_ref_array() 4 /home/voltgrooming/www/wp-includes/functions.php(1336): WP->main() 5 /home/voltgrooming/www/wp-blog-header.php(16): wp() 6 /home/voltgrooming/www/wp-activate.php(14): require(‘…’) 7 {main}

    thrown in /home/voltgrooming/www/wp-content/themes/volt2024/functions.php on line 194

    I think we need to know if your changed getUserWholeSaleRole() to something else, since that’s what is on line 194.

    But this code that we added (below) was provided by one of your support staff so that we could exempt Wholesale users from purchasing subscription products:

    add_action( ‘wp’ , function() {

    global $wc_wholesale_prices_premium;
    $user_wholesale_role = $wc_wholesale_prices_premium->wwpp_wholesale_roles->getUserWholesaleRole();

     if ( is_product() || is_cart() || is_shop() ) {
    if ( isset($user_wholesale_role[0]) ) {
    echo '<style type="text/css">ul.wcsatt-options-prompt-radios, ul.wcsatt-options, small.wcsatt-sub-options{ display: none; } }</style>';
    }
    }
    } , 10, 4 );

    Thanks

    • This topic was modified 8 months, 3 weeks ago by JVM Design.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘getUserWholeSaleRole() error’ is closed to new replies.