{{ line_item.fulfillment.tracking_number}} doesnt work on order view?

Solved
Tourist
10 1 1

hi im trying to add {{ line_item.fulfillment.tracking_number}} to display shipping tracking number and company to Order Printer plugin wich handles order viewing and printing but it just ignores it, i even made sure to use a working real fedex tracking number but it just gets ignored, does the liquid tag got obsolete? 

1 Like

Hey, you will probably need to add this to your code first:

 

{% for line_item in order.line_items %}
 
....
 
{% endfor %} 
 
Could you try and let me know if that helps? Otherwise you could maybe post the code here where you have these troubles!
We help eCommerce people achieve their Goals! Visit us on: Webmefy.com
0 Likes
Tourist
10 1 1
<p style="float: right; text-align: right; margin: 0;">
  {{ date | date: "%d/%m/%Y - %I:%M%p" }}<br />
  Pedido {{ order_name }}
</p>

<div style="float: left; margin: 0 0 1.5em 0;" >
  <strong style="font-size: 2em;"><img src="https://ci4.googleusercontent.com/proxy/Eznt9wVr1viWeMbLisiBO40Ng0Oym06Pvc7mI73B8jQ-IRdi95Y4If9Sgn4ACXheWrd8QZglFnriqDTfTQDJNE-qGYQnJHPdx3Z5sxZUsU3Edd4FEbN4k04AIAKrAUTfx2ujnU7-z7uVh4U9Nw=s0-d-e1-ft#https://cdn.shopify.com/s/files/1/0045/0700/9096/email_settings/Dilmun_logo_350px.jpg?2007" width="150">
</strong><br />
  {{ shop.address }} #{{ shop.address2 }}<br/>
  {{ shop.city }}<br/>
  {{ shop.country }}, {{ shop.province_code }}<br>
  {{ shop.zip | upcase }}
</div>

<hr />

<h3 style="margin: 0 0 1em 0;">Detalle de pedido</h3>

<table class="table-tabular" style="margin: 0 0 1.5em 0;">
  <thead>
    <tr>
      <th>Cantidad</th>
      <th>Artículo</th>
      {% if show_line_item_taxes %}
      <th>Impuestos</th>
      {% endif %}
      <th>Precio</th>
    </tr>
  </thead>
  <tbody>
    {% for line_item in line_items %}
      <tr>
        <td>{{ line_item.quantity }} x</td>
        <td>{{ line_item.title }}</td>
        {% if line_item.tax_lines %}
          <td>
            {% for tax_line in line_item.tax_lines %}
              {{ tax_line.price | money }} <br/>
            {% endfor %}
          </td>
        {% endif %}
        <td>
          {% if line_item.original_price != line_item.price %}
            <s>{{ line_item.original_price | money }}</s>
          {% endif %}
          {{ line_item.price | money }}
        </td>
      </tr>
    {% endfor %}
  </tbody>
</table>

{% if transactions.size > 1 %}
  <h3 style="margin: 0 0 1em 0;">Detalle de transacciones</h3>
  <table class="table-tabular" style="margin: 0 0 1.5em 0;">
    <thead>
      <tr>
        <th>Tipo</th>
        <th>Cantidad</th>
        <th>Especie</th>
        <th>Estado</th>
      </tr>
    </thead>
    <tbody>
      {% for transaction in transactions %}
        <tr>
          <td>{{ transaction.gateway | payment_method }}</td>
          <td>{{ transaction.amount | money }}</td>
          <td>{{ transaction.kind }}</td>
          <td>{{ transaction.status }}</td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
{% endif %}

<h3 style="margin: 0 0 1em 0;">Detalle del pago</h3>

<table class="table-tabular" style="margin: 0 0 1.5em 0;">
  <tr>
    <td>Subtotal:</td>
    <td>{{ subtotal_price | money }}</td>
  </tr>
  {% for discount in discounts %}
  <tr>
    <td>Incluye descuento "{{ discount.code }}"</td>
    <td>{{ discount.savings | money }}</td>
  </tr>
  {% endfor %}
  <tr>
    <td>Impuestos:</td>
    <td>{{ tax_price | money }}</td>
  </tr>
  {% if shipping_address %}
    <tr>
      <td>Envío:</td>
      <td>{{ shipping_price | money }}</td>
    </tr>
  {% endif %}
  <tr>
    <td><strong>Total:</strong></td>
    <td><strong>{{ total_price | money }}</strong></td>
  </tr>
  {% if total_paid != total_price %}
    <tr>
      <td><strong>Total pagado:</strong></td>
      <td><strong>{{ total_paid | money }}</strong></td>
    </tr>
    <tr>
      <td><strong>Gran Total:</strong></td>
      <td><strong>{{ total_price | minus: total_paid | money }}</strong></td>
    </tr>
  {% endif %}
</table>

{% if note %}
  <h3 style="margin: 0 0 1em 0;">Nota</h3>
  <p>{{ note }}</p>
{% endif %}

{% if shipping_address %}
  <h3 style="margin: 0 0 1em 0;">Detalles del envío</h3>

<div style="margin: 0 0 1em 0; padding: 1em; border: 1px solid black;">
  <table>
	   <tbody>
		     <tr>
			    <td style="width: 49%;">  
                    <strong>{{ shipping_address.name | upcase  }}</strong><br/>
                    {% if shipping_address.company %}
                    {{ shipping_address.company }}<br/>
                    {% endif %}
                    {{ shipping_address.street }}<br/>
                    {{ shipping_address.city }}, {{ shipping_address.country }}<br>
                    {{ shipping_address.zip | upcase }}
                </td>
                <td style="width: 49%;"><b>Fecha estimada de entrega: {{ fulfillment.tracking_number }}<br>
                Numero de rastreo: 
              {% for line_item in order.line_items %}
                {% if line_item.fulfillment.tracking_number %}
                    <a href="{{ line_item.fulfillment.tracking_url }}" target="_blank">{{ 

line_item.fulfillment.tracking_company }} #{{ line_item.fulfillment.tracking_number}}</a>
                {% endif %}
                <br>
              {% endfor %}
            </td>   
        </tr>
    </tbody>
  </table>
</div>


{% endif %}

<p align="center">Si tienes alguna duda, por favor envía un correo a <u>{{ shop.email }}</u>
<h3 align="center" style="margin: 0 0 1em 0;">Gracias por comprar en Dilmun</h3></p>

heres the code, thanks!!

0 Likes
Highlighted

y si estás seguro de que la orden en la que lo estás probando tiene un número de tracking disponible?

We help eCommerce people achieve their Goals! Visit us on: Webmefy.com
0 Likes
Tourist
10 1 1

hola, si de hecho incluso agregué un numero de rastreo valido que use hace unas semanas

0 Likes
Shopify Partner
1734 48 156
  • Verify Data exists at all
  • Verify existence of data in the context your using
  • Verify Conditionals

 

If your not getting output on something , next verify data, here confirm an order that you know has a tracking url

shopify.com/admin/api/2019-04/orders/#{order_id}/fulfillments.json

 

Also which specific file are you trying to add this to? See the email variables reference for notifications as I believe fulfillment variables are only allowed in some notification templates.

 

Verify your conditionals are even working:

            {% for line_item in order.line_items %}
                {% if line_item.fulfillment.tracking_number %}
                  TestString                {% endif %}
                <br>              {% endfor %} 

 

 

Problem Solved? ✔️Accept the solution so you can help others.
Confused? Busy? ? Get me to solve it paull.newton+shopifyforum@gmail.com.
Buy me a coffee? ☕ paypal.me/paulnewton or donate to eff.org
0 Likes
Tourist
10 1 1

im trying to add this information to order template, not to be confused with email notifications, i tried the json address but it gives me a https error and the browser wont allow me any further

0 Likes
Shopify Partner
1734 48 156

@mariosolis wrote:

im trying to add this information to order template,

customers/order.liquid?

 


@mariosolis wrote:

i tried the json address but it gives me a https error and the browser wont allow me any further


You have to add the proper order id and updated it for your store

Problem Solved? ✔️Accept the solution so you can help others.
Confused? Busy? ? Get me to solve it paull.newton+shopifyforum@gmail.com.
Buy me a coffee? ☕ paypal.me/paulnewton or donate to eff.org
0 Likes
Tourist
10 1 1

@PaulNewton wrote:

@mariosolis wrote:

im trying to add this information to order template,

customers/order.liquid?

 


@mariosolis wrote:

i tried the json address but it gives me a https error and the browser wont allow me any further


You have to add the proper order id and updated it for your store


its order template, main dash myshopify area you click on "orders",  then on the order number, inside the order resume and preview theres a "more actions" option i select "Print with Order Printer" and shows me a sort of printable form filled with the order info, on the right side of it says "Edit" and thats where i found the code, it cohabits with the shipping sticker (packing slip) template if that helps locating it

0 Likes

Success.

Tourist
10 1 1
<td style="width: 49%;">
                    {% for line_item in line_items %}
                    {% if line_item.fulfillment.tracking_number %}
                    <b>Fecha estimada de entrega: {{ fulfillment.tracking_number }}<br>
                    <b>Compañía: {{ line_item.fulfillment.tracking_company }} <br>
                    Numero de rastreo: <a href="{{ line_item.fulfillment.tracking_url }}" target="_blank"> #{{ line_item.fulfillment.tracking_number}}</a></br>
                    {% endif %}
                    <br>
                    {% endfor %}
                </td>   

solved it, i had to change the for cycle, just removed the "order." and its back on rails, thanks for the support

0 Likes