App reviews, troubleshooting, and recommendations
Looked EVERYWHERE trying to find the correct coding to add a "Refunded Amount" line to the Payment details in my Order Printer template...
Current Code
<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>
<td>{{ subtotal_price | money }}</td>
</tr>
{% if shipping_address %}
<tr>
<td>Shipping:</td>
<td>{{ shipping_price | money }}</td>
</tr>
{% endif %}
{% if line_item.tax_lines %}
<td>
{% for tax_line in line_item.tax_lines %}
{{ tax_line.price | money }} {{ tax_line.title }}<br/>
{% endfor %}
</td>
{% endif %}
<tr>
<td>Total tax:</td>
<td>{{ total_tax | money }}</td>
</tr>
</td>
<tr>
<td><strong>Total price:</strong></td>
<td><strong>{{ total_price | money }}</strong></td>
</tr>
{% for discount in discounts %}
<tr>
<td>Includes discount "{{ discount.code }}"</td>
<td>{{ discount.savings | money }}</td>
</tr>
{% endfor %}
{% if total_paid != total_price %}
<tr>
<td><strong>Total paid:</strong></td>
<td><strong>{{ total_paid | money }}</strong></td>
</tr>
{% endif %}
</table>
<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>
<td>{{ subtotal_price | money }}</td>
</tr>
{% if shipping_address %}
<tr>
<td>Shipping:</td>
<td>{{ shipping_price | money }}</td>
</tr>
{% endif %}
{% if line_item.tax_lines %}
<td>
{% for tax_line in line_item.tax_lines %}
{{ tax_line.price | money }} {{ tax_line.title }}<br/>
{% endfor %}
</td>
{% endif %}
<tr>
<td>Total tax:</td>
<td>{{ total_tax | money }}</td>
</tr>
<tr>
<td><strong>Total price:</strong></td>
<td><strong>{{ total_price | money }}</strong></td>
</tr>
{% for discount in discounts %}
<tr>
<td>Includes discount "{{ discount.code }}"</td>
<td>{{ discount.savings | money }}</td>
</tr>
{% endfor %}
{% assign refunded_amount = 0 %}
{% for transaction in transactions %}
{% if transaction.kind == 'refund' %}
{% assign refunded_amount = refunded_amount | plus: transaction.amount %}
{% endif %}
{% endfor %}
{% if refunded_amount > 0 %}
<tr>
<td>Refunded Amount:</td>
<td>{{ refunded_amount | money }}</td>
</tr>
{% endif %}
{% if total_paid != total_price %}
<tr>
<td><strong>Total paid:</strong></td>
<td><strong>{{ total_paid | money }}</strong></td>
</tr>
{% endif %}
{% assign outstanding_amount = total_price | minus: refunded_amount | minus: total_paid %}
{% if outstanding_amount > 0 %}
<tr>
<td><strong>Outstanding Amount:</strong></td>
<td><strong>{{ outstanding_amount | money }}</strong></td>
</tr>
{% endif %}
</table>
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025