You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
The text was updated successfully, but these errors were encountered: