$billing['city'] ) ? $billing['city'] : null, 'billing_state' => isset( $billing['state'] ) ? $billing['state'] : null, 'billing_postcode' => isset( $billing['postcode'] ) ? $billing['postcode'] : null, 'billing_country' => isset( $billing['country'] ) ? $billing['country'] : null, 'billing_email' => isset( $request['billing_address'], $request['billing_address']['email'] ) ? $request['billing_address']['email'] : null, 'billing_phone' => isset( $request['billing_address'], $request['billing_address']['phone'] ) ? $request['billing_address']['phone'] : null, 'shipping_first_name' => isset( $shipping['first_name'] ) ? $shipping['first_name'] : null, 'shipping_last_name' => isset( $shipping['last_name'] ) ? $shipping['last_name'] : null, 'shipping_company' => isset( $shipping['company'] ) ? $shipping['company'] : null, 'shipping_address_1' => isset( $shipping['address_1'] ) ? $shipping['address_1'] : null, 'shipping_address_2' => isset( $shipping['address_2'] ) ? $shipping['address_2'] : null, 'shipping_city' => isset( $shipping['city'] ) ? $shipping['city'] : null, 'shipping_state' => isset( $shipping['state'] ) ? $shipping['state'] : null, 'shipping_postcode' => isset( $shipping['postcode'] ) ? $shipping['postcode'] : null, 'shipping_country' => isset( $shipping['country'] ) ? $shipping['country'] : null, ) ); wc()->customer->save(); $cart->calculate_shipping(); $cart->calculate_totals(); return rest_ensure_response( $this->schema->get_item_response( $cart ) ); } }