<p>I don't think there is any in-built way to do this, no.</p>
<p>A relatively easy hack to achieve it, though, is to loop through your shipping methods (as youare) - but rather than directly outputting them, instead add the data to a twig array (possibly adding some extra data long the way, such as a <code>sortOrder</code> of your choosing, based on the handle) - and then use Twig's <code>sort</code> to sort your options based on your desired criteria (e.g. the aformentioned <code>sortOrder</code> or just by e.g. the price - before then actually outputting those options from the array, rather than the initial direct loop.</p>
<p>It's not awesome/elegant, but it works!</p>

CC BY-SA 4.0
2020-09-16T04:01:44.860Z
2020-09-16T04:01:44.860Z
Jeremy Daalder
<p>If there are multiple shipping methods available for an order, is there way to control the order in which they appear?</p>
<p>The CP doesn't seem to offer a way to re-order them. I'm using something like the following code to retrieve all available methods.</p>
<pre><code>{% for handle, method in cart.availableShippingMethods %}
&lt;input type=&quot;radio&quot; id=&quot;{{ handle }}&quot; name=&quot;shippingMethodHandle&quot; value=&quot;{{ handle }}&quot; /&gt;
&lt;label for=&quot;{{ handle }}&quot;&gt;{{ method.name }}&lt;/label&gt;&lt;br&gt;
{% endfor %}
</code></pre>
<p>Craft Pro (3.4.28.1) &amp; Craft Commerce Pro (3.1.12)</p>

<plugin-craftcommerce><plugin-craftcommerce3>
Is there a way to control the order of appearance of shipping methods in Craft Commerce?
# Is there a way to control the order of appearance of shipping methods in Craft Commerce?

(Asked by: username_0 on 2020-07-26)

If there are multiple shipping methods available for an order, is there way to control the order in which they appear?
The CP doesn't seem to offer a way to re-order them. I'm using something like the following code to retrieve all available methods.
{% for handle, method in cart.availableShippingMethods %}

{{ method.name }}
{% endfor %}

Craft Pro (3.4.28.1) & Craft Commerce Pro (3.1.12)

**Tags:** plugin-craftcommerce, plugin-craftcommerce3


---

## 1 answers

### Answer by username_1 on 2020-09-16. Score: 1

I don't think there is any in-built way to do this, no.

A relatively easy hack to achieve it, though, is to loop through your shipping methods (as youare) - but rather than directly outputting them, instead add the data to a twig array (possibly adding some extra data long the way, such as a `sortOrder` of your choosing, based on the handle) - and then use Twig's `sort` to sort your options based on your desired criteria (e.g. the aformentioned `sortOrder` or just by e.g. the price - before then actually outputting those options from the array, rather than the initial direct loop.

It's not awesome/elegant, but it works!


---

