WC_Gateway_Paypal_Request::get_paypal_shipping_preferenceprivateWC 1.0

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

Method of the class: WC_Gateway_Paypal_Request{}

No Hooks.

Returns

String.

Usage

// private - for code of main (parent) class only
$result = $this->get_paypal_shipping_preference( $order );
$order(WC_Order) (required)
Order object.

WC_Gateway_Paypal_Request::get_paypal_shipping_preference() code WC 10.4.3

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

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