show item prices on packing slip - line_item.properties?

As you know the solution from @BrianAtWork was very useful but it’s not working anymore. I mixed many of the coding from this forum and I found a new solution that works now. The prices will be shown just for the products that have a SKU.

This is how it looks:

This is the new coding:


  

    

      

        {{ shop.name }}
      

    

    
      

        Order {{ order.name }}
      

      

        {{ order.created_at | date: "%B %e, %Y" }}
      

    

  

  
    

      

        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 %}
          {% if shipping_address.city_province_zip != blank %}
            

            {{ shipping_address.city_province_zip }}
          {% endif %}
          

          {{ 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 %}
          {% if billing_address.city_province_zip != blank %}
            

            {{ billing_address.city_province_zip }}
          {% endif %}
          

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

    

  

  

---

  
    

      

        

          Items 
        

      

      
        

          Quantity
        

      

    

    {% comment %}
    To adjust the size of line item images, change desired_image_size.
    The other variables make sure your images print at high quality.
    {% endcomment %}
    {% assign desired_image_size = 58 %}
    {% 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_in_shipment %}
      
        

          {% if line_item.image != blank %}
            

              {{ line_item.image | img_url: effective_image_dimensions | img_tag: '', 'aspect-ratio__content' }}
            

          {% endif %}
        

        
          

            
              {{ line_item.title }}
            
            {% if line_item.variant_title != blank %}
              
                {{ line_item.variant_title }}
              
            {% endif %}            
           
            {% if line_item.sku != blank %}
              
                {{ line_item.sku }}
            

 {%- comment -%} ********adding prices to packing slip *********{%- endcomment -%}
 
            {% assign final_price = nil %}
              {% for item in order.line_items %}
                {% if item.sku == line_item.sku %}
                  {% assign final_price = item.final_price %}
                {% endif %}
              {% endfor %}
              {% if final_price %}
                 {{ final_price | money }}
              {% endif %}                
          
                
 {%- comment -%} ********done adding prices to packing slip *********{%- endcomment -%}                
              
            {% endif %}
          

        

          
          

           {{ line_item.shipping_quantity }} of {{ line_item.quantity }}
          

        

      

    {% endfor %}

{%- comment -%} ******** adding totals to packing slip *********{%- endcomment -%}       
    
    

    

    Subtotal {{  order.subtotal_price | money }}
    

    Taxes {{  order.tax_price | money }}
    

    Shipping {{  order.shipping_price | money }}
    

    Total {{  order.total_price | money }}
          

        
    
{%- comment -%} ******** done adding totals to packing slip *********{%- endcomment -%}       

  

  {% unless includes_all_line_items_in_order %}
    

---

    

      There are other items from your order not included in this shipment.
    

  {% endunless %}
  

---

  {% if order.note != blank %}
    
      

        Notes
      

      

        {{ order.note }}
      

    

  {% endif %}
  
    

      Thank you for shopping with us!
    

    

      <strong>
        {{ shop.name }}
      </strong>
      

      {{ shop_address.address1 }}, {{ shop_address.city }}, {{ shop_address.province_code }}, {{ shop_address.zip }}, {{ shop_address.country }}
      

      {{ shop.email }}
      

      {{ shop.domain }}
    

  

1 Like