Merge branch 'trunk' of github.com:woocommerce/woocommerce-paypal-payments into PCP-375-order-of-woocommerce-checkout-ac

This commit is contained in:
dinamiko 2021-11-04 12:12:13 +01:00
commit 02519b7f35
10 changed files with 89 additions and 127 deletions

View file

@ -296,7 +296,7 @@ class CreateOrderEndpoint implements EndpointInterface {
* @throws RuntimeException If create order request fails.
*/
private function create_paypal_order( \WC_Order $wc_order = null ): Order {
$needs_shipping = WC()->cart && WC()->cart->needs_shipping();
$needs_shipping = WC()->cart instanceof \WC_Cart && WC()->cart->needs_shipping();
$shipping_address_is_fix = $needs_shipping && 'checkout' === $this->parsed_request_data['context'];
return $this->api_endpoint->create(