How to change the text of the delivery address and invoicing address on the page received when ordering woocommerce?

I use woocommerce to create a store in wordpress. I changed the text of the payment data to the delivery details and vice versa through the following code

function wc_custom_addresses_labels( $translated_text, $text, $domain )
{
    switch ( $translated_text )
    {
        case 'Billing Address' : /* Front-end */
            $translated_text = __( 'Shipping Address', 'woocommerce' );
            break;

        case 'Billing Details' : // Back-end 
            $translated_text = __( 'Shipping Detail', 'woocommerce' );
            break;

        case 'Ship to a different address?' : 
            $translated_text = __( 'Bill to a different address?', 'woocommerce' );
            break;

        case 'Shipping Details' : // Back-end 
            $translated_text = __( 'Billing Detail', 'woocommerce' );
            break;
    }
    return $translated_text;
}
add_filter( 'gettext', 'wc_custom_addresses_labels', 20, 3 );

But after that, on the page received when ordering,

The invoice details and delivery information have the same text and delivery address you can check here - http://screencast.com/t/BKOYuAg48W

+4
source share
1 answer

You can change the display according to the needs of your theme.

See the structure of the woocommerce template ...

Follow the instructions in the links.

order/order-details.php ...

woo-commerce ...

+3

Source: https://habr.com/ru/post/1529861/


All Articles