Automattic\WooCommerce\Gateways\PayPal

Request::get_paypal_shipping_preference │ private │ WC 1.0

Get the shipping preference for the PayPal create-order request.

Метод класса: Request{}

Хуков нет.

Возвращает

string.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->get_paypal_shipping_preference( $order ): string;
$order(WC_Order) (обязательный)
Order object.

Код Request::get_paypal_shipping_preference() WC 11.2.2

private function get_paypal_shipping_preference( WC_Order $order ): string {
	if ( ! $order->needs_shipping() ) {
		return PayPalConstants::SHIPPING_NO_SHIPPING;
	}

	$address_override = $this->gateway->get_option( 'address_override' ) === 'yes';
	return $address_override ? PayPalConstants::SHIPPING_SET_PROVIDED_ADDRESS : PayPalConstants::SHIPPING_GET_FROM_FILE;
}