Adding a 4th column to order printer invoice template to show the line total

I sell hardware and almost always sell large quantities of a single line item. I am currently migrating to the new order printer app and need to modify the invoice template to not only show the price per piece, but also the total price for that line item. The product table on my invoices currently look like this:

I’d like to have the “Price” column be shifted to the left and become “Price/Pc” and in it’s place have another column that is titled “Line Total” that shows the total price for each line item (essentially QTY x Price/Pc).

As a follow-up question, I’d also like to add vertical lines on the table that separate the columns of the table but can’t seem to figure that out.

The code for that table currently looks like this:


    {% for line_item in order.line_items %}
      
    {% endfor %}
    
    {% for discount in order.discounts %}
    
    {% endfor %}
    
   {% if order.shipping_address %}
  
{% endif %}
    
    {% if order.net_payment != order.total_net_amount %}
      
    {% endif %}
    {% if order.total_refunded_amount > 0 %}
      
    {% endif %}
    {% if order.net_payment != order.total_net_amount %}
      
    {% endif %}
  <table>

  
    <tr>

      <th>

Qty

</th>

      <th>

Item

</th>

      <th>

Price

</th>

    </tr>

  
  <tr>

        <td>

{{ line_item.quantity }}

</td>

        <td>

{{ line_item.title }}

</td>

        <td>

          {% if line_item.original_price != line_item.price %}
            ~~{{ line_item.original_price | money }}~~
          {% endif %}
          {{ line_item.price | money }}
        

</td>

      </tr>
<tr>

      <td colspan="2">

Subtotal:

</td>

      <td>

{{ order.subtotal_price | money }}

</td>

    </tr>
<tr>

      <td colspan="2">

Includes discount: {% if discount.code %}"{{ discount.code }}"{% endif %}

</td>

      <td>

{{ discount.savings | money }}

</td>

    </tr>
<tr>

      <td colspan="2">

Tax:

</td>

      <td>

{{ order.tax_price | money }}

</td>

    </tr>
<tr>

    <td colspan="2">

      {% if order.shipping_methods[0].title contains "pickup" %}
        Customer Pickup:
      {% else %}
        Shipping | {{ order.shipping_methods[0].title }}:
      {% endif %}
    

</td>

    <td>

{{ order.shipping_price | money }}

</td>

  </tr>
<tr>

      <td colspan="2">

**Total:**

</td>

      <td>

**{{ order.total_price | money }}**

</td>

    </tr>
<tr>

        <td colspan="2">

Total Paid:

</td>

        <td>

{{ order.net_payment | money }}

</td>

      </tr>
<tr>

        <td colspan="2">

Total Refunded:

</td>

        <td>

{{ order.total_refunded_amount | money }}

</td>

      </tr>
<tr>

        <td colspan="2">

**Outstanding Amount:**

</td>

        <td>

**{{ order.total_price | minus: order.net_payment | money }}**

</td>

      </tr>

</table>

Any help would be greatly appreciated! Thanks ahead of time.

Hey @FairWind , I think you need a customized invoice according to the specifics of the hardware product.
Customization as you describe needs to involve code editing. Look for professional invoicing apps that support customization to create your own invoice style.

Your comment isn’t very helpful as it doesn’t address any of my questions. There are better ways to push your monthly subscription shopify app than by advertising it without providing any help on forums that are meant to be for community help. Plenty of devs here still take the time to respond in a meaningful way and actually help the community.

  • I have explored all of the custom solutions that work with the new order printer app, including yours, and they don’t meet my needs.

  • I do not want to add yet another app that offers professional invoicing and comes with a monthly charge when they are chock full of features that I don’t require for my store.

  • I understand that the customization that I have described is going to require coding on the template, that’s why I included the code.

  • The invoice I have is working just fine apart from that simple changes I want to make to the table.

1 Like

Give this a shot:


      {% for line_item in order.line_items %}
        
      {% endfor %}
      
      {% for discount in order.discounts %}
      
      {% endfor %}
      
     {% if order.shipping_address %}
    
  {% endif %}
      
      {% if order.net_payment != order.total_net_amount %}
        
      {% endif %}
      {% if order.total_refunded_amount > 0 %}
        
      {% endif %}
      {% if order.net_payment != order.total_net_amount %}
        
      {% endif %}
    <table>

    
      <tr>

        <th>

Qty

</th>

        <th>

Item

</th>

        <th>

Price/Pc

</th>

        <th>

Line Total

</th>

      </tr>

    
    <tr>

          <td>

{{ line_item.quantity }}

</td>

          <td>

{{ line_item.title }}

</td>

          <td>

            {% if line_item.original_price != line_item.price %}
              ~~{{ line_item.original_price | money }}~~
            {% endif %}
            {{ line_item.price | money }}
          

</td>

          <td>

            {{ line_item.final_line_price | money }}
          

</td>

        </tr>
<tr>

        <td colspan="3">

Subtotal:

</td>

        <td>

{{ order.subtotal_price | money }}

</td>

      </tr>
<tr>

        <td colspan="3">

Includes discount: {% if discount.code %}"{{ discount.code }}"{% endif %}

</td>

        <td>

{{ discount.savings | money }}

</td>

      </tr>
<tr>

        <td colspan="3">

Tax:

</td>

        <td>

{{ order.tax_price | money }}

</td>

      </tr>
<tr>

      <td colspan="3">

        {% if order.shipping_methods[0].title contains "pickup" %}
          Customer Pickup:
        {% else %}
          Shipping | {{ order.shipping_methods[0].title }}:
        {% endif %}
      

</td>

      <td>

{{ order.shipping_price | money }}

</td>

    </tr>
<tr>

        <td colspan="3">

**Total:**

</td>

        <td>

**{{ order.total_price | money }}**

</td>

      </tr>
<tr>

          <td colspan="3">

Total Paid:

</td>

          <td>

{{ order.net_payment | money }}

</td>

        </tr>
<tr>

          <td colspan="3">

Total Refunded:

</td>

          <td>

{{ order.total_refunded_amount | money }}

</td>

        </tr>
<tr>

          <td colspan="3">

**Outstanding Amount:**

</td>

          <td>

**{{ order.total_price | minus: order.net_payment | money }}**

</td>

        </tr>

  </table>
2 Likes

Thanks again MakP for another solution. That gives me enough to work with that I can edit the details on my own. Much appreciated!

I would like to do this as well. Where do I place this code and what should It replace? Thanks!