Closed rakibabu closed 5 years ago
Why using an regex when you can use Magento\Sales\Model\Order\Addres::explodeStreetAddress().
Because the second street can contain a house number including an extension. Closing this issue now, as this was resolved in v1.0.8, see commit: https://github.com/Paazl/magento2-checkout-widget/commit/b29c637a6a7c837e35f5401b30cd20391459198b
Please feel free to reopen the issue if the problem still occurs.
The solution is still not compatible with german housenumber additions, Why closing this issue?
Hi Paazl,
There's a bug in you module. In this file: https://github.com/Paazl/magento2-checkout-widget/blob/master/Model/Api/Builder/Order.php#L167 there's an preg_replace with 4 parameters, the 4th parameter as subject.(https://www.php.net/manual/en/function.preg-replace.php) This generates an error and the order is not send to Paazl.
In addition to that, the preg_replace only gets the 0-9 nummeric values. If you fix the bug with the preg_replace the house number addition is sending twice the house number. Is code is cleary not tested. If the order has the values 34a in the second street address. The order is received as 34 34 in Paazl.
I've made a PR(https://github.com/Paazl/magento2-checkout-widget/pull/11) to fix this and added the option to add the third street line as housenumber addition. I didn't fix the preg_replace nummeric values with two street lines because this can't be splitted. Housenumber additions can be nummeric, floors etc. You'll have to find an method to fix this. Referrer: https://www.phpliveregex.com/p/to7
Can you please merge my PR so we can you the third street as house number addition?
Thanks in advance.
Rakibabu