我正在尝试按shipping_address.name
{% assign orders = customer.orders | sort: 'shipping_address.name' %}
{% for order in orders %}
<tr class="{% cycle 'odd', 'even' %} {% if order.cancelled %}cancelled_order{% endif %}">
<td>{{ order.name | link_to: order.customer_url }}</td>
<td><span class="ship_name">{{ order.shipping_address.name }}</span></td>
<td><span class="note">{{ order.created_at | date: format: 'month_date_year' }}</span></td>
<td><span class="status_{{ order.financial_status }}">{{ order.financial_status }}</span></td>
<td><span class="status_{{ order.fulfillment_status }}">{{ order.fulfillment_status }}</span></td>
<td><span class="total money">{{ order.total_price | money }}</span></td>
</tr>
{% endfor %}
答案 0 :(得分:0)
你忘了使用已排序的数组!通过稍微重命名变量,我更容易理解。
{{1}}
希望你睡得充足!