Use order raw address instead of formatted for filter

This commit is contained in:
Risto Niinemets 2019-06-04 08:13:40 +03:00
parent de1dfbb1b4
commit dbc9719d76
1 changed files with 2 additions and 4 deletions

View File

@ -882,14 +882,12 @@ class WC_Order extends WC_Abstract_Order {
* @return string
*/
public function get_formatted_shipping_address( $empty_content = '' ) {
$address = '';
$address = apply_filters( 'woocommerce_order_formatted_shipping_address', $this->get_address( 'shipping' ), $this );
if ( $this->has_shipping_address() ) {
$address = WC()->countries->get_formatted_address( $this->get_address( 'shipping' ) );
$address = WC()->countries->get_formatted_address( $address );
}
$address = apply_filters( 'woocommerce_order_formatted_shipping_address', $address, $this );
return $address ? $address : $empty_content;
}