WC_Order::get_formatted_billing_address( string $empty_content = '' )

Get a formatted billing address for the order.


Description Description


Parameters Parameters

$empty_content

(Optional) Content to show if no address is present. @since 3.3.0.

Default value: ''


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/class-wc-order.php

	public function get_formatted_billing_address( $empty_content = '' ) {
		$raw_address = apply_filters( 'woocommerce_order_formatted_billing_address', $this->get_address( 'billing' ), $this );
		$address     = WC()->countries->get_formatted_address( $raw_address );

		/**
		 * Filter orders formatterd billing address.
		 *
		 * @since 3.8.0
		 * @param string   $address     Formatted billing address string.
		 * @param array    $raw_address Raw billing address.
		 * @param WC_Order $order       Order data. @since 3.9.0
		 */
		return apply_filters( 'woocommerce_order_get_formatted_billing_address', $address ? $address : $empty_content, $raw_address, $this );
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.