plentymarkets / plentymarkets-shopware-connector

plentymarkets shopware connector plugin
http://www.plentymarkets.eu/shopware/
MIT License
30 stars 51 forks source link

Split street and house number #168

Closed franzlst closed 7 years ago

franzlst commented 7 years ago
Q A
issue or Enhancement issue
Version 2.0.1

A customer entered the following address:

Frau X Y
Eliasstr 
8
12345 Z
Deutschland

The street was entered in the street field, the number in the additional address line field.

Actual Behavior

[2017-06-02 09:09:16] plentyconnector.ERROR: Command failed: HandleOrderCommand {"adapterName":"PlentymarketsAdapter","transferObject":"da8808c2-ca85-4aea-9b4c-c26ab567fa92","exception":"[object] (InvalidArgumentException(code: 0): Address 'Eliasstr' could not be splitted into street name and house number at /var/www/web1/htdocs/shopware/custom/plugins/PlentyConnector/vendor/viison/address-splitter/src/AddressSplitter.php:48)"} 

Expected Behavior

Do not expect a number in the street field.

kaspizzo commented 7 years ago

That calls for problems in PM, as PM always expects a valid street number, doesn't it?

jochenmanz commented 7 years ago

Hallo franzlst,

as kaspozzo pointed out, pm needs a valid street number. Without the process will fail on a different level, most likely when the connector tries to create/update the customer.

Best regards, Jochen

franzlst commented 7 years ago

I would like to reopen this issue. I think the house number handling should be more robust.

This time, a customer entered the street and number in the additional address field and the company name in the street field. This causes the order not to be transferred, without further notice if using the cronjob.

We really don't have many orders, so this can manually be checked. But I can imagine, for bigger shops, this can really be a problem.

What about try to find a number in the additional address line field, if it cannot be found in the street field? This would have worked in my both cases. Or setting house number to -1/0/1/99999 if it cannot be found?

jochenmanz commented 7 years ago

Hallo Franz,

i am open for feedback on how to create a more robust function, but i do see some limitations in both shopware and plentymarkets which prevent "magic". Also, I would advice against creating orders with a wrong street number. What seems possible is to mark the order in shopware somewhat broken, with a spezial order status maybe, or even send a mail on parsing errors. Both would be possible and extensible for further customisations.

Best regards, Jochen

kaspizzo commented 7 years ago

It would probably be best to catch wrong input via javascript or browser field validation during the checkout.