myparcelnl / prestashop

PrestaShop module to integrate with MyParcel NL and BE
https://developer.myparcel.nl/nl/documentatie/11.prestashop.html
10 stars 5 forks source link

[BETA]: Module uses customer information from account rather than from address #266

Open PollyKant opened 1 month ago

PollyKant commented 1 month ago

Version check

MyParcelNL version

v4.0.0-beta.3

PrestaShop version

8.1.7

PHP version

8.1

What went wrong?

When sending data to MyParcelNL, in myparcelnl/src/Pdk/Base/Adapter/PsAddressAdapter.php "person" is created twice, in createFromAddress() from an address, and in createFromCustomer() from a customer account. Both those methods are combined to a single result in fromOrder() method, and "person" information from account is being used. In a situations when customers account have different personal information than adress this means that wrong data is being send, and later wrong labels are being printed.

Reproduction steps

  1. Create an account.
  2. Create an address with different name and last name.
  3. Make an order using myparcelnl delivery method.
  4. Log in to backoffice.
  5. Go to orders page.
  6. Export order created in step 3.
  7. Log in to https://account.myparcel.nl/ account.
  8. Go to Shipments -> Summary.
  9. See "Recipient" column for an order exported in step 6.

Relevant log output

No response

Additional context

No response