<p>Does your shipping method have any conditions set? Like a country or region? I think <code>getAvailableShippingMethods()</code> takes into account your shipping address (if any) and only shows shipping methods that apply to the current shipping details.</p>

<p>Second thing to check: does your shipping method have at least one shipping rule? Commerce needs a shipping rule to be checked against your order.</p>

CC BY-SA 4.0
2020-02-20T13:33:59.690Z
I thought that might be the case so I deleted everything and started again. I just have one Shipping Method setup with no rules or zones and I'm using the general category. Thanks for your help
NixonAnt
CC BY-SA 4.0
2020-02-20T13:38:50.967Z
Stupid question: does your shipping method have shipping rules? A shipping rules has to match the order for the shipping method to be available. Look at https://github.com/craftcms/commerce/blob/master/src/models/ShippingRule.php#L213-L295 to see how the matching is done, it might help you figure out what's wrong?
Paul
CC BY-SA 4.0
2020-02-20T14:06:04.553Z
I added a rule just to see and it now works. Seems that the method requires at least one rule. Thanks again for your help
NixonAnt
CC BY-SA 4.0
2020-02-20T14:07:00.063Z
Yes, the method always requires at least one shipping rule to be matched to your order! I will add that to my answer, for future reference :)
Paul
CC BY-SA 4.0
2020-02-20T13:08:04.560Z
2020-02-20T14:07:48.280Z
2020-02-20T14:07:48.280Z
Paul
<p>I have created a shipping method in the CP but when I output <code>cart.availableShippingMethods</code> a null value is returned. I've checked my database and the shipping method is there.</p>

<p>Is there something I'm missing?</p>

<craft3><plugin-craftcommerce2><shipping>
Available Shipping Methods Returns Null
# Available Shipping Methods Returns Null

(Asked by: username_0 on 2020-02-20)

I have created a shipping method in the CP but when I output `cart.availableShippingMethods` a null value is returned. I've checked my database and the shipping method is there.

Is there something I'm missing?

**Tags:** craft3, plugin-craftcommerce2, shipping

---

## 1 answers

### Answer by username_1 on 2020-02-20. Score: 1

Does your shipping method have any conditions set? Like a country or region? I think `getAvailableShippingMethods()` takes into account your shipping address (if any) and only shows shipping methods that apply to the current shipping details.

Second thing to check: does your shipping method have at least one shipping rule? Commerce needs a shipping rule to be checked against your order.

> **Comments:**
> **username_0**: I thought that might be the case so I deleted everything and started again. I just have one Shipping Method setup with no rules or zones and I'm using the general category. Thanks for your help  
> **username_1**: Stupid question: does your shipping method have shipping rules? A shipping rules has to match the order for the shipping method to be available. Look at https://github.com/craftcms/commerce/blob/master/src/models/ShippingRule.php#L213-L295 to see how the matching is done, it might help you figure out what's wrong?  
> **username_0**: I added a rule just to see and it now works. Seems that the method requires at least one rule. Thanks again for your help  
> **username_1**: Yes, the method always requires at least one shipping rule to be matched to your order! I will add that to my answer, for future reference :)  

---

