I have 3 types of prices in WP and I need to change price for each specific user role using hooks

I know this isn’t the answer you’re looking for – but you’re setting yourself up for quite a bit of work. The Woocommerce Wholesale Suite does exactly what you need flawlessly without all the extra work (aswell as role specific payment methods / shipping methods). https://en-gb.wordpress.org/plugins/woocommerce-wholesale-prices/

Execute function only for specific user roles

You can exclude certain roles like this: 1- Create a function to check if the current user role is excluded: function isPasswordValidationSkipped() { // Fill this array with roles that you want to exclude from password validation $excludedRoles = [‘subscriber’]; $user = wp_get_current_user(); foreach ($user->roles as $role) { if(in_array($role, $excludedRoles)) { return true; } } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)