0

I want that user having special role assigned can buy product from my store without pay. I searched around and found Role based shipping/payment plugin. This plugin works fine for other user role but it do not allow user having special role to place order.

Is there a way to allow only users with special role to place order without any payment and shipping method?

Thanks in advance.

dev tester
  • 327
  • 1
  • 10
  • 25

1 Answers1

0

You can modify price by this function.Please take backup and perform modifications.

public function get_db_price($id){ 
            $user = wp_get_current_user();
            if($user->roles[0] == "VIP"){

                return 0;
            }
            else{
            self::$db_prices = get_post_meta($id,'_role_based_price',true );  
            if(is_array(self::$db_prices)){
                return self::$db_prices;
            }
            }
            return false;
        }
Vasim Shaikh
  • 4,485
  • 2
  • 23
  • 52