VATin adres in wrong place

The VATin add-on places the retrieved address in the wrong field.
Now it places it all in ""address1"" however it should be splitting it up in mailcode (7553HT) and city (Hengelo OV)
The Companyname is placed correct.

Is it possible to automaticly delete non-valid VATnumbers.

The VIES service just returns a textarea e.g.

STREETNAME IN CAPITALS
LINE 2 WITH ASSUMABLY POSTCODE AND CITY

Since addresses are country specific we can only rely on line 1. The logic is trying to split the rows by line breaks:

$address1 = preg_replace('/^(.)(?:\r|\n)./', '$1', $result->address);

Try the following to output some debug what's inside your specific result:

Find

  return array(
    'tax_id' => $vatin,
    'company' => $company,
    'address1' => trim($address1),
  );

Replace with

  return array(
    'tax_id' => $vatin,
    'company' => $company,
    'address1' => trim($address1),
    'alert' => print_r($result, true),
  );

To me its all Chinees. With all respect for the Chinees people.
I have absolutely no Idea where and what to do with these PHP lines.

Maybe, maybe If you can give me a step by step guidance I might be able to fix something. I do some translations with Notepad++ thats all.

تم إغلاق هذا الموضوع بسبب عدم النشاط لفترة طويلة، ولا يمكن إرسال المشاركات إليه.
عرض الكود على GitHub