• Resolved clickingclients

    (@clickingclients)


    Thanks for a great plugin.

    1) We have managed to tweak the Shipping Label address format via:
    a) Adding this snippet:

    add_filter( 'woocommerce_localisation_address_formats', 'filter_localisation_address_formats' );
    function filter_localisation_address_formats( $address_formats ){
        $address_formats['AU'] = "{name}\n{company}\n{address_1}\n{address_2}\n{city}\n{state} {postcode}\n{country}";
        return $address_formats;
    }

    b) Also, by adjusting a protected function (not ideal.. but we are trying to find a workaround). But this adds a <br /> to protected code to force a line break.

    protected static function merge_city_state_zip($address)
    {
    //return $address; //disabled
    $arr=array();
    $arr[]=isset($address['city']) ? $address['city'] : '';
    $arr[]=isset($address['state']) ? '<br />'.$address['state'] : '';
    $arr[]=isset($address['postcode']) ? $address['postcode'] : '';
    unset($address['state']);
    unset($address['postcode']);
    $address['city']=implode(", ",array_filter(array_values($arr)));
    return $address;
    }

    How can we achieve this on the Shipping Label without the code being overwritten next release?

    2) How can we force a label size to print? 1 1/4″ x 2 1/4″

Viewing 1 replies (of 1 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @clickingclients,

    Are you sure that you’re using our plugin? We don’t have such a method name in our code, so I guess you’re using a PDF Invoices plugin with a similar name to ours.

    Check this under Plugins > Installed Plugins: Ours is named PDF Invoices & Packing Slips for WooCommerce By WP Overnight.

Viewing 1 replies (of 1 total)
  • The topic ‘Label size & address localisation (AU) format’ is closed to new replies.