Добрый день! Подскажите пожалуйста как можно внести изменения в функцию woocommerce? Она выглядит так:
public function get_formatted_shipping_address() {
if ( ! $this->formatted_shipping_address ) {
if ( $this->shipping_address_1 || $this->shipping_address_2 ) {
// Formatted Addresses
$address = apply_filters( 'woocommerce_order_formatted_shipping_address', array(
'first_name' => $this->shipping_first_name,
'last_name' => $this->shipping_last_name,
'company' => $this->shipping_company,
'address_1' => $this->shipping_address_1,
'address_2' => $this->shipping_address_2,
'city' => $this->shipping_city,
'state' => $this->shipping_state,
'postcode' => $this->shipping_postcode,
'country' => $this->shipping_country
), $this );
$this->formatted_shipping_address = WC()->countries->get_formatted_address( $address );
}
}
return $this->formatted_shipping_address;
}
Если я меняю поля таким образом:
'first_name' => 'ФИО - '.$this->shipping_first_name,
то все работает как нужно и на почту приходит подпись поля с ФИО. Но это кривой способ тк я правлю файлы самого магазина. Подскажите как я могу отфильтровать эти данные и сделать надписи не затрагивая кор файлы магазина?