Orders re-order button showing multiple times?

New Member
52 0 0

Hello, I have created a re-order button to show on the customers/orders page which I will add the code for before. The button works fine, however it displays a button for each individual item and also a button for the whole order combined. I only want it to display for the whole order combined, Thanks. 

{% for order in customer.orders %}

  						{% assign reorder_url = "" %}
    					{% for line_item in order.line_items %}
      					{% capture reorder_url %}{{ reorder_url | append: line_item.variant_id | append: ':' | append: line_item.quantity | append: ',' }}{% endcapture %}
  						{% endfor %}

  						<a href="{{ '/cart/' | append: reorder_url }}">Re-order</a>
						{% endfor %}<span> | </span>
                      <a href="/account">Back to my account</a>
0 Likes