postnl / postnl-magento2

This is the official Magento 2 extension for the logistics company PostNL. Add shipping options and parcelshops to your checkout. Create labels with track and trace functionality from the backend.
59 stars 60 forks source link

[BUG] 2.4.3-p2 mail track_and_trace not showing delivery time. #303

Closed leonhelmus closed 2 years ago

leonhelmus commented 2 years ago

To Reproduce Steps to reproduce the behavior:

  1. Create a order with postnl
  2. Process the order
  3. Create shipment
  4. Click on button: PostNL - Confirm And Print Shipment Label

Expected result Delivery time / dateAndTime is shown.

Actual result Delivery time / dateAndTime is shown are not shown.

Workaround Add this patch to resolve issues, because of new way of writing email variables:

--- a/view/frontend/email/track_and_trace.html
+++ b/view/frontend/email/track_and_trace.html
@@ -33,10 +33,10 @@

                                 <ul style=" list-style:square; padding-left: 30px; ">
                                     <li style=" color: #868681; vertical-align: top;">
-                                        <b style="font-weight: normal; font-size: 14px; ">{{trans "Order"}} {{var order.getIncrementId()}}</b><br/>
-                                        {{var DateAndTime}}
+                                        <b style="font-weight: normal; font-size: 14px; ">{{trans "Order"}} {{var order.increment_id}}</b><br/>
+                                        {{var dateAndTime}}
                                     </li>
-                                    {{if postnlShipment.getPostNLOrder().getDeliveryDate()}}
+                                    {{if delivery_date}}
                                     <li style=" color: #868681; vertical-align: top;">
                                         <b style="font-weight: normal; font-size: 14px; ">{{trans "Expected Delivery"}}</b><br/>
                                         {{var delivery_date}}
@@ -55,10 +55,10 @@
                                         {{var street}}
                                     </li>
                                     <li style=" color: #868681; vertical-align: top;">
-                                        {{var shippingAddress.getCity()}} {{var shippingAddress.getPostcode()}}
+                                        {{var shippingAddress.city}} {{var shippingAddress.postcode}}
                                     </li>
                                     <li style=" color: #868681; vertical-align: top;">
-                                        {{var shippingAddress.getCountryId()}}
+                                        {{var shippingAddress.country_id}}
                                     </li>
                                 </ul>

Screenshots If applicable, add screenshots to help explain your problem.

Please complete the following information

tig-jeffreybranderhorst commented 2 years ago

Hi @leonhelmus,

Thank you for bringing this to our attention, we are in testing phase for the new releasing, so this helps us a lot! I will give this issue and your patch to the team to test en release with the new release!

Have a nice day, Jeffrey

kaybeudeker commented 2 years ago

Please update the docs as well; https://docs.tig.nl/pages/viewpage.action?pageId=8553643

tig-vincentthart commented 2 years ago

Hi @kaybeudeker

Thank you for providing this patch. We have included it within the v1.12.2 release.

Have a nice day! Vincent

kaybeudeker commented 2 years ago

Credits (should) go to @leonhelmus for providing the actual patch šŸ‘šŸ¼. I just mentioned the related docs.

tig-vincentthart commented 2 years ago

@kaybeudeker

you are right. Thanks a lot @leonhelmus for the provided patch!

leonhelmus commented 2 years ago

No problem glad it was used :)