Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Display labels for Billing/Shipping Address

$
0
0

Replies: 0

Hi,

Would love to add labels to the address on “order_addresses” section in print-content.php.

Right now it can be confusing for delivery personnel if the user has not explicitly mentioned Road number etc.

For example, this is a sample address the way it is currently:

    Username
    Company name
    address
    address 2
    city
    1234

derived from
echo wp_kses_post( apply_filters( 'wcdn_address_billing', $order->get_formatted_billing_address(), $order ) );

What do I need to do to output the labels of these fields to display like this:

    CLIENT NAME: Username
    CLIENT COMPANY: Company name
    CLIENT ADDRESS_1: address
    CLIENT ADDRESS_2: address 2
    CLIENT CITY: city
    1234

I can replace

echo wp_kses_post( apply_filters( 'wcdn_address_billing', $order->get_formatted_billing_address(), $order ) );

with

echo 'Address 1 '.$order->get_billing_address_1().', ';
echo 'Address 2 '.$order->get_billing_address_2().', ';
echo 'City '.$order->get_billing_city().', ';
echo 'State '.$order->get_billing_state();

But is there a more elegant solution?

Thank you


Viewing all articles
Browse latest Browse all 59525

Trending Articles