<p>I fixed it by deleteing line 15 and 17 on orderssetting twig template, than updating entry on db with save button, than restoring twig template</p>

CC BY-SA 3.0
2016-08-08T03:38:59.467Z
Was this with the stock Commerce templates or were modifications made?  If you think you found a bug, can you submit details and steps to reproduce to support@craftcommerce.com?
Brad Bell
CC BY-SA 3.0
2016-08-07T20:19:21.323Z
2016-08-07T20:19:21.323Z
vigan.abd
<p>I'm trying to add a product to cart but response is http status code 500. How can i fix it?. I'm using a basic Craft Commerce template and just created some products.</p>

CC BY-SA 3.0
2016-08-07T19:50:32.463Z
When i enabled debug mode php shows me this:
Fatal error: Call to a member function getFieldLayout() on null in C:\Users\Vigan\Desktop\XAMPP_Subdomains\DevTest\craft\plugins\commerce\models\Commerce_OrderModel.php on line 192
vigan.abd
CC BY-SA 3.0
2016-08-07T20:04:04.240Z
The problem stands at orderssetting template it returns error on line 15     {% if orderSettings.id %}<input type="hidden" name="orderSettingsId" value="{{ orderSettings.id }}">{% endif %}
vigan.abd
<plugin-craftcommerce>
Add to cart returning error code 500
# Add to cart returning error code 500

(Asked by: username_0 on 2016-08-07)

I'm trying to add a product to cart but response is http status code 500. How can i fix it?. I'm using a basic Craft Commerce template and just created some products.

**Tags:** plugin-craftcommerce

> **Comments:**
> **username_0**: When i enabled debug mode php shows me this: Fatal error: Call to a member function getFieldLayout() on null in C:\Users\Vigan\Desktop\XAMPP_Subdomains\DevTest\craft\plugins\commerce\models\Commerce_OrderModel.php on line 192  
> **username_0**: The problem stands at orderssetting template it returns error on line 15     {% if orderSettings.id %}<input type="hidden" name="orderSettingsId" value="{{ orderSettings.id }}">{% endif %}  

---

## 1 answers

### Answer by username_0 on 2016-08-07. Score: 0

I fixed it by deleteing line 15 and 17 on orderssetting twig template, than updating entry on db with save button, than restoring twig template

> **Comments:**
> **username_1**: Was this with the stock Commerce templates or were modifications made?  If you think you found a bug, can you submit details and steps to reproduce to support@craftcommerce.com?  

---

