Problem/Motivation
Tracking information: prints from commerce-shipment-confirmation.html.twig even when there is no tracking code.
It is parented under an attempt to check if the tracking code is not empty:
{% if (tracking_code) %}
{% block tracking_info %}
<tr>
<td style="font-weight: bold; padding-top:15px; padding-bottom: 15px; text-align: left; vertical-align: top; border-top: 1px solid #cccccc">
{{ 'Tracking information:'|t }}
https://git.drupalcode.org/project/commerce_shipping/-/blob/8.x-2.x/temp...
I'm guessing the reason that checking the variable tracking_code doesn't work is because it is checking the view mode, rather than the entity's field itself.
https://git.drupalcode.org/project/commerce_shipping/-/blob/8.x-2.x/src/...
Checking the tracking_code
itself directly off the entity, and explicitly checking that it's not empty works. {% if shipment_entity.tracking_code is not empty %}
Also, we shouldn't only thank people for their order if it has a tracking code.
https://git.drupalcode.org/project/commerce_shipping/-/blob/8.x-2.x/temp...
Steps to reproduce
Send an email with no tracking code.
Proposed resolution
Fix it.
Comment | File | Size | Author |
---|---|---|---|
#2 | 3265283-2.patch | 1.24 KB | tonytheferg |
|
Comments
Comment #2
tonytheferg CreditAttribution: tonytheferg commentedComment #3
4kant CreditAttribution: 4kant commentedThanks - that worked for me!
Comment #5
jsacksick CreditAttribution: jsacksick at Centarro commentedCommitted, thanks!