← back to Dw Theme Compact Toolbar
templates/customers/account.liquid
89 lines
<script>
/* Route trade-professional signups to the benefits page after account creation. */
(function () {
try {
if (sessionStorage.getItem('dw_trade')) {
sessionStorage.removeItem('dw_trade');
window.location.replace('/pages/trade-only-benefits');
}
} catch (e) {}
})();
</script>
<div class="customer-section">
<h1 class="page-title">
{% if customer.first_name != blank %}
{{ 'customers.account.header' | t: customer_name: customer.first_name }}
{% else %}
{{ 'general.breadcrumbs.account' | t }}
{% endif %}
</h1>
{% render 'breadcrumbs' %}
<div class="customer-wrapper">
<div class="account-info">
{% if customer.default_address != nil %}
<p class="customer-address">
{% assign address = customer.default_address %}
<span class="section-title">{{ address.first_name }} {{ address.last_name }}</span>
{% if address.company != blank %}
<span>{{ address.company }}</span><br>
{% endif %}
{% if address.street != blank %}
<span>{{ address.street }}</span><br>
{% endif %}
{% if address.city != blank or address.province_code != blank %}
<span>{{ address.city }}{% if address.province_code %}, {{ address.province_code }}{% endif %}</span><br>
{% endif %}
{% if address.country != blank or address.zip != blank %}
<span>{{ address.country }} {{ address.zip }}</span><br>
{% endif %}
{% if address.phone != blank %}
<span>{{ address.phone }}</span><br>
{% endif %}
</p>
{% endif %}
{% if customer.addresses_count == 0 %}
{% capture newAddressLink %}
<a href="{{ routes.account_addresses_url }}">{{ 'customers.account.new_address_link' | t }}</a>
{% endcapture %}
<p>{{ 'customers.account.no_addresses_html' | t: new_address_link: newAddressLink }}</p>
{% else %}
<p><a href="{{ routes.account_addresses_url }}">{{ 'customers.account.edit_addresses' | t }}</a></p>
{% endif %}
</div>
<div class="account-history">
{% if customer.orders.size > 0 %}
<table class="account-orders">
<thead>
<tr>
<th class="first">{{ 'customers.account.order' | t }}</th>
<th>{{ 'customers.account.payment' | t }}</th>
<th>{{ 'customers.account.fulfillment' | t }}</th>
<th class="last">{{ 'general.general.total' | t }}</th>
</tr>
</thead>
<tbody>
{% for order in customer.orders %}
<tr class="{% render 'for-looper', forloop: forloop %} {% if order.cancelled %}cancelled_order{% endif %}">
<td class="account-order-number first" data-title="{{ 'customers.account.order' | t }}">{{ order.name | link_to: order.customer_url }} <span class="date">- {{ order.created_at | date: format: 'short_month' }}</span></td>
<td class="account-order-payment-status {{ order.financial_status }}" data-title="{{ 'customers.account.payment' | t }}">{{ order.financial_status_label | capitalize }}</td>
<td class="account-order-fulfillment-status {{ order.fulfillment_status }}" data-title="{{ 'customers.account.fulfillment' | t }}">{{ order.fulfillment_status_label | capitalize }}</td>
<td class="account-order-total last" data-title="{{ 'general.general.total' | t }}"><span class="money">{{ order.total_price | money }}</span></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="empty">{{ 'customers.account.empty' | t }}</p>
{% endif %}
</div>
</div>
</div>