Can’t change payment method after order is placed
-
Hi!
I can’t change the order payment method from admin panel (edit order) after the order is placed, even if I set it manually to the desired value (bacs).
add_action( ‘woocommerce_process_shop_order_meta’, ‘woocommerce_process_shop_order’, 10, 2 );
function woocommerce_process_shop_order ( $order_id ) {
// no luck
update_post_meta( $order_id, ‘_payment_method’, ‘bacs’ );// also no luck
$order = wc_get_order( $order_id );
$order->set_payment_method( WC()->payment_gateways->payment_gateways()[‘bacs’]);
$order->save();// even if I delete it, woocommerce always add original value (cod) at the end of the meta data array
delete_post_meta( $order_id, ‘_payment_method’);
}Any ideas? Thanks, Goran
- The topic ‘Can’t change payment method after order is placed’ is closed to new replies.