Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Delivery date has a wrong check. #615

Closed
JoostWan opened this issue Dec 14, 2021 · 1 comment
Closed

[BUG] Delivery date has a wrong check. #615

JoostWan opened this issue Dec 14, 2021 · 1 comment
Assignees
Labels
bug Something isn't working In progress Next version

Comments

@JoostWan
Copy link

Describe the bug

When a customer orders a package on 13 December it will be delivered 14 December. When the shop owner want to print the label at 14 December it's not working and showing a error Error in MyParcel API request: data.shipments[0].options.delivery_date - data.shipments[0].options.delivery_date delivery_date is too early.

This is because the date check is delivery date <= today. This is always false in this case. For now I change this line https://github.com/myparcelnl/magento/blob/main/Helper/Data.php#L165 to:

$todayDate = strtotime('now +1 day');

Found also a second bug. In the file TrackTraceHolder.php there is a call to convert the date. But the module uses not the date but a json array with checkout data: https://github.com/myparcelnl/magento/blob/main/Model/Sales/TrackTraceHolder.php#L277

$deliveryDate = date('d-m-Y', strtotime($this->helper->convertDeliveryDate($checkoutData)));

[14-Dec-2021 10:35:09 UTC] {"isPickup":true,"date":"2021-12-14T16:00:00.000Z","carrier":"postnl","deliveryType":"pickup","pickupLocation":{"location_name":"XXX","location_code":"XXX","retail_network_id":"XXX","cc":"NL","city":"XX","street":"XXX","postal_code":"XXXX","number":"XX","number_suffix":"XXX"}}

Module version: 4.1.8

@RichardPerdaan
Copy link
Member

This issue is solved on 17 feb 2022 in version: 4.3.0-alpha.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working In progress Next version
Development

No branches or pull requests

2 participants