How can I show the true subtotal before discounts in Order Printer?

brokenalice
Tourist
4 0 3

The default template of Order Printer is not showing the true subtotal of the items in this order. This order is a retail cost of $229.00 BEFORE the discount is applied. I want the Subtotal Price to be be $229.00 and THEN show the discount. Please help me edit the liquid so I can get the TRUE subtotal before discounts. 

 

This example picture is of a custom discount, but the same thing happens when a customer uses a coupon or an automatic discount is applied. The Subtotal does not show the TRUE retail total of the items. The Liquid code below is the default. 

 

subtotal.jpg

Here is a copy of the default liquid starting at "Payment Details". 

 

subtotal liquid.jpg

Reply 1 (1)

Mishkananda
Visitor
1 0 0

My dear Brokenalice,

Here is the solution, in Spanish and in English.

Years waiting for a solution, hope Shopify brings me a gift or th universe.

 

Screenshot 2023-02-28 at 20.14.27.pngScreenshot 2023-02-28 at 20.12.24.png

 

 For Spanish

This code:

 

<p style="float: right; text-align: right; margin: 0;">
<b>Fecha Factura</b>:{{ date | date: "%d/%m/%Y" }} <br />
Factura numero {{ order_name }}
</p>

<div style="float: left; margin: 0 0 1.5em 0;" >
<strong style="font-size: 2em;">{{ shop_name }}</strong><br /><br />
{{ shop.address }}<br/>
{{ shop.city }} {{ shop.province_code }} {{ shop.zip | upcase }}<br/>
{{ shop.country }}
<br>
<strong>VAT: ESX2900430S</strong>
<br>
<strong>Nombre: ROKSOLANA KISHCHUK
<br>
<strong>Cuenta Bancaria: ES30 0182 1078 8702 0154 7056
<br>
<strong>BIZUM: 607656851
</div>

<hr />

<h3 style="margin: 0 0 1em 0;">Item Details</h3>

<table class="table-tabular" style="margin: 0 0 1.5em 0;">
<thead>
<tr>
<th>Articulo</th>
<th>Cantidad</th>
{% if show_line_item_taxes %}
<th>Precio Unitario</th>
{% endif %}
<th>Precio Total</th>
</tr>
</thead>


<tbody>
{% for line_item in line_items %}
<tr>
<td><b>{{ line_item.title }}</b></td>
<td>{{ line_item.quantity }} x</td>
<td> {{ line_item.price | money }}</td>
{% if show_line_item_taxes %}
<td>
{% for tax_line in line_item.tax_lines %}
{{ line_item.price | times: line_item.quantity | money }} {{ tax_line.title }}<br/>
{% endfor %}
</td>
{% endif %}
{% if line_item.tax_lines %}

 


<td>
{% assign subtotal_before_tax = subtotal_before_tax | plus: line_item.price | minus: tax_line.price %}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>

 

 


{% if transactions.size > 1 %}
<h3 style="margin: 0 0 1em 0;">Transaction Details</h3>
<table class="table-tabular" style="margin: 0 0 1.5em 0;">
<thead>
<tr>
<th>Type</th>
<th>Amount</th>
<th>Kind</th>
<th>Status</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;">Payment Details</h3>

<table class="table-tabular" style="margin: 0 0 1.5em 0;">
<tr>
<td>Precio Subtotal:</td>

{%- comment -%} Modified by Ryan A at Shopify on October 7 2021 {%- endcomment -%}
<td>{{ total_price | minus: discounts_savings | money}}</td>
{%- comment -%} End of changes by Ryan A at Shopify {%- endcomment -%}

</tr>
{% for discount in discounts %}
<tr>
<td>Descuentos Incluidos: "{{ discount.code }}"</td>
<td>{{ discount.savings | money }}</td>
</tr>
{% endfor %}
{% if shipping_address %}
<tr>
<td>Costo de envio:</td>
<td>{{ shipping_price | money }}</td>
</tr>
{% endif %}
<tr>
<td>Impuestos totales Incluidos:</td>
<td>{{ tax_price | money }}</td>
</tr>
</td>


</tr>
<tr>
<td><strong>Precio Total:</strong></td>
<td><strong>{{ total_price | money }}</strong></td>
</tr>
{% if total_paid != total_price %}
<tr>
<td><strong>Precio Pagado:</strong></td>
<td><strong>{{ total_paid | money }}</strong></td>
</tr>
<tr>
<td><strong>Outstanding Amount:</strong></td>
<td><strong>{{ total_price | minus: total_paid | money }}</strong></td>
</tr>
{% endif %}
</table>

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

{% if shipping_address %}
<h3 style="margin: 0 0 1em 0;">Shipping Details</h3>

<div style="margin: 0 0 1em 0; padding: 1em; border: 1px solid black;">
<strong>{{ shipping_address.name }}</strong><br/>
{{ shipping_address | format_address }}
</div>
{% endif %}

<p>Si tiene alguna consulta, por favor envie un mail a <u>{{ shop.email }}</u></p>

 

For English

This Code:

 

<p style="float: right; text-align: right; margin: 0;">
<br>{{ transaction.date | "%d/%m/%y" }}<br />
Invoice for {{ order_name }}
</p>

<div style="float: left; margin: 0 0 1.5em 0;" >
<strong style="font-size: 2em;">{{ shop_name }}</strong><br /><br />
{{ shop.address }}<br/>
{{ shop.city }} {{ shop.province_code }} {{ shop.zip | upcase }}<br/>
{{ shop.country }}


<hr />

<h3 style="margin: 0 0 1em 0;">Item Details</h3>

<table class="table-tabular" style="margin: 0 0 1.5em 0;">
<thead>
<tr>
<th>Item</th>
<th>Quantity</th>
{% if show_line_item_taxes %}
<th>Unit Price</th>
{% endif %}
<th>Total Price</th>
</tr>
</thead>


<tbody>
{% for line_item in line_items %}
<tr>
<td><b>{{ line_item.title }}</b></td>
<td>{{ line_item.quantity }} x</td>
<td> {{ line_item.price | money }}</td>
{% if show_line_item_taxes %}
<td>
{% for tax_line in line_item.tax_lines %}
{{ line_item.price | times: line_item.quantity | money }} {{ tax_line.title }}<br/>
{% endfor %}
</td>
{% endif %}
{% if line_item.tax_lines %}

 


<td>
{% assign subtotal_before_tax = subtotal_before_tax | plus: line_item.price | minus: tax_line.price %}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>

 

 


{% if transactions.size > 1 %}
<h3 style="margin: 0 0 1em 0;">Transaction Details</h3>
<table class="table-tabular" style="margin: 0 0 1.5em 0;">
<thead>
<tr>
<th>Type</th>
<th>Amount</th>
<th>Kind</th>
<th>Status</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;">Payment Details</h3>

<table class="table-tabular" style="margin: 0 0 1.5em 0;">
<tr>
<td>Subtotal price:</td>

{%- comment -%} Modified by Ryan A at Shopify on October 7 2021 {%- endcomment -%}
<td>{{ total_price | minus: discounts_savings | money}}</td>
{%- comment -%} End of changes by Ryan A at Shopify {%- endcomment -%}

</tr>
{% for discount in discounts %}
<tr>
<td>Includes discount "{{ discount.code }}"</td>
<td>{{ discount.savings | money }}</td>
</tr>
{% endfor %}
{% if shipping_address %}
<tr>
<td>Shipping:</td>
<td>{{ shipping_price | money }}</td>
</tr>
{% endif %}
<tr>
<td>Total tax included:</td>
<td>{{ tax_price | money }}</td>
</tr>
</td>


</tr>
<tr>
<td><strong>Total price:</strong></td>
<td><strong>{{ total_price | money }}</strong></td>
</tr>
{% if total_paid != total_price %}
<tr>
<td><strong>Total paid:</strong></td>
<td><strong>{{ total_paid | money }}</strong></td>
</tr>
<tr>
<td><strong>Outstanding Amount:</strong></td>
<td><strong>{{ total_price | minus: total_paid | money }}</strong></td>
</tr>
{% endif %}
</table>

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

{% if shipping_address %}
<h3 style="margin: 0 0 1em 0;">Shipping Details</h3>

<div style="margin: 0 0 1em 0; padding: 1em; border: 1px solid black;">
<strong>{{ shipping_address.name }}</strong><br/>
{{ shipping_address | format_address }}
</div>
{% endif %}

<p>If you have any questions, please send an email to <u>{{ shop.email }}</u></p>