Support » Plugin: WooCommerce Shipping Label » Post code position not right for US

  • Resolved cfm168

    (@cfm168)


    Hell,

    I can see now the postcode followed by City name (Los Angeles 12345), this is not for US format.

    Is it possible to make it print like below to meet US standard style?

    Los Angeles, California 12345

    Thanks in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author webtoffee

    (@webtoffee)

    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;
    }

    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.

    Plugin Author webtoffee

    (@webtoffee)

    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.

    Yes, this code works.

    Thank you very much!

    Plugin Author webtoffee

    (@webtoffee)

    Hi @cfm168,

    Glad to have helped. It would be awesome if you could leave us a review here.

    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.

    Plugin Author webtoffee

    (@webtoffee)

    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;
    }
Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.