Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
use Cart needs payment instead of Order needs payment
Browse files Browse the repository at this point in the history
  • Loading branch information
senadir committed Oct 18, 2021
1 parent 8ac5108 commit f358e4c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/StoreApi/Routes/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,9 @@ private function update_customer_from_request( \WP_REST_Request $request ) {
*/
private function update_order_from_request( \WP_REST_Request $request ) {
$this->order->set_customer_note( $request['customer_note'] ?? '' );
$this->order->set_payment_method( $this->order->needs_payment() ? $this->get_request_payment_method( $request ) : '' );

$cart = $this->cart_controller->get_cart_instance();
$this->order->set_payment_method( $cart->needs_payment() ? $this->get_request_payment_method( $request ) : '' );

/**
* Fires when the Checkout Block/Store API updates an order's from the API request data.
Expand Down

0 comments on commit f358e4c

Please sign in to comment.