Shopify Order Printer Migration / Issue with addresses populating on custom template

Hi there! I’m working on migrating our custom template from the legacy shopify printer app and everything else seems to be populating correctly except our Ship To & Bill To on the template. I tried to see if I had missed something from the legacy variables to be updated but can’t seem to make sense of it.

Can someone take a peek at this code and tell me if I’m missing something to be updated? Thank you!


  

    

      

        Ship to
      

      

        {% if shipping_address != blank %}
          {{ shipping_address.name }}
          {% if shipping_address.company != blank %}
            

            {{ shipping_address.company }}
          {% endif %}
          

          {{ shipping_address.address1 }}

          {% if shipping_address.address2 != blank %}
            {{ shipping_address.address2 }}

          {% endif %}
          {{ shipping_address.city }}
          {% if shipping_address.province_code != blank %}
            {{ shipping_address.province_code }}
          {% endif %}
          {{ shipping_address.zip | upcase }}
          

          {{ shipping_address.country }}
        {% else %}
          No shipping address
        {% endif %}
      

    

    
      

        Bill to
      

      

        {% if billing_address != blank %}
          {{ billing_address.name }}
          {% if billing_address.company != blank %}
            

            {{ billing_address.company }}
          {% endif %}
          

          {{ billing_address.address1 }}

          {%  if billing_address.address2 != blank %}
            {{ billing_address.address2 }}

          {% endif %}
          {{ billing_address.city }}
          {% if billing_address.province_code != blank %}
            {{ billing_address.province_code }}
          {% endif %}
          {{ billing_address.zip | upcase }}
          

          {{ billing_address.country }}
        {% else %}
          No billing address
        {% endif %}
      

    

  

I don’t have a solution, but I am watching this post as I’m having the same issue!

Actually, I think I do have a solution! I found this in another post… wherever you have “shipping_address” and “billing_address” in the code, add “order.” to the front of it. So it will look like: “order.shipping_address” and “order.billing_address” - it worked for me!

Thank you @florapothecarie !! Rockstar. This worked. The only thing I can’t seem to figure out that “order.” isn’t working for is our product title for the order. Usually it says the product name next to the image in this blank spot. Do you have any similar issues? Or does anyone have any tips out there?

Code below! Thank you!

{% assign desired_image_size = 50 %}
  {% assign resolution_adjusted_size = desired_image_size | times: 300 | divided_by: 72 | ceil %}
  {% capture effective_image_dimensions %}
    {{ resolution_adjusted_size }}x{{ resolution_adjusted_size }}
  {% endcapture %}

  {% for line_item in line_items %}
    
      

        {% if line_item.image != blank %}
          

            {{ line_item.image | img_url: 'thumb' | img_tag: line_item.variant }}
          

        {% else %}
          
            
          

        {% endif %}
      

      
        

          
            {{ line_item.product_title }}
          
        

      

      
        {% for option in line_item.product.options %}
          

            {% if forloop.index == 1 %}
              {{option}}{{ 
 line_item.variant.option1 }}
            {% elsif forloop.index == 2 %}
              {{option}}{{ 
 line_item.variant.option2 }}
            {% elsif forloop.index == 3 %}
              {{option}}{{ 
 line_item.variant.option3 }}