Skip to content

Leftover %S for addresses #26

@iMusicJJ

Description

@iMusicJJ

Hey,

It looks like the formatter some countries is a little off.
I've seen it for Italy and Spain with a Danish locale.

Below is the format for Italy for example:

"fmt":"%N%n%O%n%A%n%Z %C %S"

As far as I can tell, it is leaving the %S leftover.

Image

Image

Image

It could be happening to other locales as well.

We are using the package as such:

$formatter = new AddressFormat\Format();

$formatter->setLocale($locale ?? $address->country->iso);

$formatter['ADMIN_AREA'] = $address->state;
$formatter['LOCALITY'] = $address->city;
$formatter['RECIPIENT'] = trim($address->name . "\n" . $address->att);
$formatter['ORGANIZATION'] = $address->company;
$formatter['POSTAL_CODE'] = $address->zip;
$formatter['STREET_ADDRESS'] = trim($address->street . "\n" . $address->street2);

$formatted = $formatter->formatAddress() . "\n" . $address->country->caption($lang);

It seems to have happened after upgrading from 1.5.0 to 2.0.0 - and I can confirm, downgrading to 1.5.0 fixes the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions