Hi @cfm168
You may please try this code snippet with the latest version of the plugin.
This code goes in your active theme functions.php
add_filter( 'wt_woocommerce_shipping_lable_shipping_address', 'wt_modify_shipping_address' );
function wt_modify_shipping_address( $shipping_address ) {
$shipping_city = $shipping_address[ 'city' ];
$shipping_state = $shipping_address[ 'state' ];
$shipping_address[ 'state' ] = $shipping_city;
$shipping_address[ 'city' ] = $shipping_state;
return $shipping_address;
}
Thread Starter
cfm168
(@cfm168)
Thank you for helping.
This snippet doesn’t work even after updating the plugin new version released today. I tested with the orders those generated earlier than this snippet.
Hi @cfm168,
Please try this code snippet instead.
add_filter('wt_woocommerce_shipping_lable_shipping_address', 'wt_modify_shipping_address');
function wt_modify_shipping_address($shipping_address)
{
$shipping_state=$shipping_address['state'];
$shipping_address['state']='';
$shipping_address['city'].=', '.$shipping_state;
return $shipping_address;
}
Clear the site cache if the changes don’t reflect.
Hi @cfm168,
Glad to have helped. It would be awesome if you could leave us a review here.
Thread Starter
cfm168
(@cfm168)
Hello @webtoffee,
I found the post code printed outside of label 4×6, it is because you are using full name for all states.
TO:
David Young
ABC Company Limited
1111 Bartholomew St
Peabody, Massachusetts – 01960
United States (US)
Ph No : 1234567890
Can you please put the post code on lower row like below:
TO:
David Young
ABC Company Limited
1111 Bartholomew St
Peabody, Massachusetts
Postcode – 01960
United States (US)
Ph No : 1234567890
Your help will be appreciated.
Hi @cfm168,
Please try usng below code snippet.
add_filter('wt_woocommerce_shipping_lable_shipping_address', 'wt_modify_shipping_address');
function wt_modify_shipping_address($shipping_address)
{
$shipping_state=$shipping_address['state'];
$shipping_address['state']='';
$shipping_address['city'].=', '.$shipping_state.'<br/>'.__('Postcode');
return $shipping_address;
}