0

i have 2 payment gateways cash on delivery and online payment, admin can create order from dashboard i want to unset online payment if order is created from dasboard .. itried this but it didn't work .. anyone can help me please ?

function payment_gateway_disable_payment_method( $available_gateways){

   if(is_admin()){

    unset(  $available_gateways['accept_paymob_gateway'] );
   }

   return $available_gateways;
}
add_filter( 'woocommerce_available_payment_gateways', 'payment_gateway_disable_payment_method' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.