Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

Commit

Permalink
Order
Browse files Browse the repository at this point in the history
- Add information about order's transactions by showing a table with
information about each transaction.
- Add en translations for titles in transactions' columns
More about transactions object in liquid: https://help.shopify.com/themes/liquid/objects/transaction
  • Loading branch information
8geonirt committed Jun 13, 2018
1 parent 47160d0 commit 161abb8
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/locales/en.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,17 @@
"total": "Total",
"fulfilled_at": "Date fulfilled",
"track_shipment": "Track shipment",
"transactions": "Transactions",
"transaction_number": "Transaction #",
"tracking_url": "Tracking link",
"tracking_company": "Carrier",
"tracking_number": "Tracking number",
"transaction_amount": "Amount",
"transaction_name": "Name",
"transaction_status": "Status",
"transaction_kind": "Type",
"transaction_gateway": "Payment provider",
"transaction_credit_card": "Credit card",
"subtotal": "Subtotal"
},
"recover_password": {
Expand Down
40 changes: 39 additions & 1 deletion src/templates/customers/order.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,45 @@
</tfoot>
</table>

<h3>{{ 'customer.order.billing_address' | t }}</h3>
<h3>{{ 'customer.order.transactions' | t }}</h3>

{% for transaction in order.transactions %}
<h4>{{ 'customer.order.transaction_number' | t }}: {{ transaction.id}}</h4>
<table class="responsive-table">
<thead>
<tr>
<th>{{ 'customer.order.transaction_amount' | t }}</th>
<th>{{ 'customer.order.transaction_name' | t }}</th>
<th>{{ 'customer.order.transaction_status' | t }}</th>
<th>{{ 'customer.order.transaction_kind' | t }}</th>
<th>{{ 'customer.order.transaction_gateway' | t }}</th>
<th>{{ 'customer.order.transaction_credit_card' | t }}</th>
</tr>
</thead>
<tbody>
<tr>
<td data-label="{{ 'customer.order.transaction_amount' | t }}">
{{ transaction.amount | money }}
</td>
<td data-label="{{ 'customer.order.transaction_name' | t }}">
{{ transaction.name }}
</td>
<td data-label="{{ 'customer.order.transaction_status' | t }}">
{{ transaction.status_label }}
</td>
<td data-label="{{ 'customer.order.transaction_kind' | t }}">
{{ transaction.kind }}
</td>
<td data-label="{{ 'customer.order.transaction_gateway' | t }}">
{{ transaction.gateway }}
</td>
<td data-label="{{ 'customer.order.transaction_credit_card' | t }}">
{{ transaction.payment_details.credit_card_number }}
</td>
</tr>
</tbody>
</table>
{% endfor %}

<p>{{ 'customer.order.payment_status' | t }}: {{ order.financial_status_label }}</p>

Expand Down

0 comments on commit 161abb8

Please sign in to comment.