• Resolved tim_ma

    (@dampfrad)


    Hallo,

    nach dem heutigen WooCommerce Update erhalte ich beim erfolglosen generieren eines DHL Labels die Fehlermeldung Shipping “Address 2” is empty!

    Ich nutze WP 4.9.9, DHL for Woocommerce 1.3.10, Woocommerce 3.5.4, Germanized Pro 1.9.9 (Germanized 2.2.7) auf Enfold 4.5.1

    Das Generieren eines Labels für eine Packstation funktioniert nach wie vor leider auch noch nicht

    Besten Dank vorab

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter tim_ma

    (@dampfrad)

    For 2 adresses behind each other it did not work, the following orders worked well again. i cannot clearly replicate what happened with the orders not working. I′ll close this and come back to you when i have issues again

    Hallo,

    Ich habe das selbe Problem seit dem Letzten update, bekomme ich immer wieder die Meldung “Address 2” is empty!
    was für mich nicht nachvollziehbar ist das diese meldung nicht immer kommt sondern nur hin und wieder. wenn ich im Backend dann das Feld Adress_2 Bearbeite und ein punkt setze bekomme ich dann auch ein Label erstellt.

    Ich nutze die neuste WordPress version 5.0.3,woocommerce Version 3.5.4, DHL Plugin Version 1.3.10

    Danke im Voraus

    Plugin Author Shadi Manna

    (@shadim)

    This issue happens if no number is found within the address or the number has a character e.g. “#111” or “no334”. Is this the case you have?

    Ich habe bei der Adresse 1 jedesmal eine Nummer drine da ich da eine abfrage eingebaut habe damit die kunden defintiv eine Hausnummer eingeben müssen.

    Adress_2 ist leer und kein zeichen vorhanden und auch wenn der Fehler auftaucht ist bei adresse2 kein wert drine.
    dieses Problem ist eigentlich nur jetzt nach dem update so davor gab es dieses problem nicht.

    Hi,
    can confirm and this is clearly a bug. The assumption that house “numbers” are numeric is wrong: Check out:

    https://de.wikipedia.org/wiki/Hausnummer#Hausnummernerg%C3%A4nzungen

    or

    https://www.mjt.me.uk/posts/falsehoods-programmers-believe-about-addresses/

    Another example to make it clearer:

    Teststr. 2A is a valid format.

    This happens in:

    // ...last found number will be 'address_2'
    				foreach ($address_exploded as $address_key => $address_value) {
    					if (is_numeric($address_value)) {
    						// Set last index as street number
    						$args['shipping_address']['address_2'] = $address_value;
    						$set_key = $address_key;
    					}
    				}

    class-pr-dhl-api-soap-label.php

    It would be better to not make any assumptions about the adress field at all (just accept the first part and let DHL handle the rest, e.g. _fail_ if the DHL API can’t handle it?)

    Has this anything to do with the adress being DHL codeable? If so, can’t the DHL API handle that? Does it report back if the adresss is not codeable?

    A short followup:

    A workaround seems to be:

    Hook into the DHL args with a filter:

    add_filter('pr_shipping_dhl_label_args', array($this, 'fix_dhl_address'), 2, 10);

    and to set the args fields there, e.g.:

    $args['shipping_address']['address_1'] = $split['streetName'];
    			$args['shipping_address']['address_2'] = $split['houseNumber'];

    (We use this: https://github.com/VIISON/AddressSplitting)

    Ihh habe mich dem Beitrag hier angeschlossen da ich keinen neuen Beitrag für ein bestehenden Fehler erstellen wollte es w?re vlt Sinvoll diesen Beitrag nicht als Erledigt zu deklarieren.

    an den Plugin Entwickler wird es zu diesen Problem ein Update geben ich denke dieses problem werden auch andere haben Benutzer haben wenn sie es noch nicht bemerkt haben,

    wir k?nnen das Problem jetzt auch besser nachvollziehen wie es @sim0nm erw?hnt hat wenn ich eine strasse “Teststrasse.2A” schreibe macht dieses Probleme obwohl es kein wirklicher fehler ist.

    • This reply was modified 6 years, 1 month ago by jakupi.
    Plugin Author Shadi Manna

    (@shadim)

    @sim0nm do you have code to split the address so it extracts the “house number” correctly?

    https://pastebin.com/auyxfJVw (untested)

    As i said, this relies on https://github.com/VIISON/AddressSplitting which is basically a huge and complex regex, it was way easier to just use that than to roll my own regex.

    Introducing that as a dependency for internal usage isn’t a problem for me, but for the plugin itself it might.

    Plugin Author Shadi Manna

    (@shadim)

    Hello all,

    Please update to version 1.3.11 and let me know if this fixes the “address 2” issue.

    Hallo , das problem scheint behoben zu sein mit adress_2 ,

    jedoch wenn jemand bei adress_1 Teststr.1 eingibt bekommt er diese fehlermeldung “SOAP-ERROR: Encoding: object has no ‘streetName’ property”

    wenn ich aber Teststr. 1 eingebe gehts wie es soll, das hei?t es muss eine leerzeile zwischen der Strasse sein ansonsten kann ich kein label drucken.

    DAnke für die Mühe.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Shipping “Address 2” is empty!’ is closed to new replies.