net price for order

Shopify Partner
8 0 1

I couldn't find a variable for total net price (total price including products, shipping, discounts without tax being applied).


Eventually worked this out which works on order printer app.


{{ total_price | minus:tax_price | money }}


Sounds simple but took me a while to figure out and there isn't any mention for net price in help or the community so thought id share and maybe help others in future looking for the answer I was. 

1 Like
New Member
2 0 1

shopify completed my request to customize the order printer template for refund to display the appropriate tax amount for the refund transaction.

I set up a separate template for refunded items.


The refund transactions do not include a tax amount variable to display when the taxes are included in the prices.

Here is the rough formula that the shopify system uses to calculate the amount of tax that is being included in the prices which is:

This is roughly how the system calculates it. The actual process is being done with code that is way more complex as it calculates it on each single item first adds the entire values together with the run on decimals and then at the very end it rounds it. This has been found to only cause a penny discrepancy between the above formula and what is in the admin in very rare cases.


how to list your refunded items with refunded prices -

<table class="table-tabular" style="margin: 0 0 1.5em 0; border: none;">

<th>Unit Price</th>


{% for refund in refunds %}

{% for refund_line_item in refund.refund_line_items %}
<td>{{ refund_line_item.quantity }} x </td>
<td><strong>{{ refund_line_item.line_item.title }}</strong></td>
<td> {{ refund_line_item.line_item.price | money }} </td>
<td> {{ refund_line_item.line_item.price | times: refund_line_item.quantity | money }} </td>
{% endfor %}
{% endfor %}




this is how to display the refund total with net and tax for the refunded amount not the total order amount.-


<h3 style="margin: 0 0 1em 0;">Refund Payment Details</h3>
<table class="table-tabular" style="margin: 0 0 1.5em 0; border: none;">
{% for transaction in refund_transactions %}
{% assign tax_amount = transaction.amount | divided_by: 120.000 | times: 20.000 %}
<td>Total tax:</td>
<td>{{ tax_amount | money }}</td>
<td>Refund net:</td>
<td>{{ transaction.amount | minus: tax_amount | money }} </td>
<td> <strong> {{ transaction.kind }}</strong></td>

<td><strong> {{ transaction.amount | money }}</strong></td>
{% endfor %}