Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'woocommerce_variation_prices', 'custom_price', 10, 2 );
- function custom_price($price, $product) {
- if (!is_user_logged_in()) return $price;
- $user = wp_get_current_user();
- $roles = ( array ) $user->roles;
- return $roles;
- if ( $roles = 'Administrator' ){
- $price = $price * 0.5;
- }
- return $price;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement