Magento2: Unable to add a new shipping-address in the checkout process.

Created on 7 Nov 2016  路  12Comments  路  Source: magento/magento2

If i try to add a new shipping address in the checkout process, there is this error:
Error occurred during "shipping_address" processing. Error occurred during "save_in_address_book" processing. Invalid type for value: "1". Expected Type: "int".

Preconditions


  1. Environment: Magento 2.1.2 without sample data is installed, PHP Version 7.0.7, mysql56

Steps to reproduce

  1. Create a new User withou any shipping or billing address
  2. Login with this User
  3. Add one product in the shopping cart
  4. Go to checkout
  5. Fill in the shipping address
  6. Choose one shipping method
  7. Try to go on but this error is shown: Error occurred during "shipping_address" processing. Error occurred during "save_in_address_book" processing. Invalid type for value: "1". Expected Type: "int".

Expected result

  1. The payment methods should be shown

Actual result

  1. Can not go on with order because of the error: Error occurred during "shipping_address" processing. Error occurred during "save_in_address_book" processing. Invalid type for value: "1". Expected Type: "int".

bildschirmfoto 2016-11-07 um 14 42 20
bildschirmfoto 2016-11-07 um 14 42 28

Checkout Cannot Reproduce Clear Description Format is valid bug report

All 12 comments

Hello everyone,
I also get the same problem, to be more precise I am attaching the post request parameters:

{"addressInformation":
{"shipping_address":
{"countryId":"IT","regionId":"571","regionCode":"NA","region":"Napoli","street":["testq"],"company":"","telephone":"123465","postcode":"80058","city":"napoli","firstname":"Test","lastname":"Test","vatId":"","save_in_address_book":true},
"billing_address":
{"countryId":"IT","regionId":"571","regionCode":"NA","region":"Napoli","street":["testq"],"company":"","telephone":"123465","postcode":"80058","city":"napoli","firstname":"Test","lastname":"Test","vatId":"","save_in_address_book":true,"saveInAddressBook":null},
"shipping_method_code":"bestway",
"shipping_carrier_code":"tablerate"
}
}

Hey,

We are also facing same issue. Does any one get the resolution ?
saveinshipping

Does any one get the solution?

Have the same issue

I am also experiencing the same problem. Any updates on this?

I have upgraded from 2.1.0 to 2.1.2 and still experiencing the same issue but only when logged in. If user is not logged in checkout works fine. I believe its a 400 error that means the data sent from the browser to magento is invalid however I cannot bug it.

@tirgil61 @docus @devsiteau @vishveskrish @vincenzo84 thank you for reporting the issue!
I performed these steps on the fresh magento 2.1.2 and it worked fine.

Experiment 2. I installed 2.1.0, created a product, created a user and placed order for him.
I upgraded to 2.1.2
I created another user and checkout worked fine for him. Order was placed successfully.

Please, provide me more details on reproducing the issue.
Which additional configuration changes did you do?
Which payment and shipping methods are enabled?
Do you use fresh installed Magento 2.1.2 or upgraded from another version? Which?

@SerhiyShkolyarenko : Yes, I have upgraded store from 2.0.2 to 2.1.2. We are still facing an issue.

@vishveskrish I performed the following steps:

  1. Installed v.2.0.2
  2. Created a product
  3. Registered customer on frontend
  4. Added product to cart
  5. Upgraded to 2.1.2
  6. Went to checkout(session didn't expire)
  7. Passed checkout successfully.
  8. Logged out
  9. Registered another customer on frontend.
  10. Added product to cart.
  11. Passed checkout successfully.

Do you have any issues when you pass this flow?
Which payment and shipping methods are enabled on your instance?

with the transition to version 2.1 changes were made in shipping.js file. For example: 2.0.9 - 2.1.2

If you have defined it in his subject and made the transition - may have problems

@tirgil61, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.

Hi, I got the same issue in M 2.2.4 sometimes, but with a custom shipping module.

the issue is occurred for logged in user, when adding a new address and don't check the checkbox to save it.
screenshot_20180711_085050

the issue still occurred after edit that address, and check the checkbox. But when the user restart the checkout process, I mean, go back to other page and then go to checkout again, and then try to add a new address without un-check the Save to address book checkbox, it works well, and the issue don't appear.

I think this error occurs when we have API or Model interface with different data types. For instance, in our interface declaration, we have a getter and setter with return type and input type as int and in the layout xml file we have not defined the dataType which is text by default.

We should have a compatible dataType in xml file as well. For example, any dataType from below.

<item name="config" xsi:type="array"> <item name="dataType" xsi:type="string">text</item> <item name="dataType" xsi:type="string">date</item> <item name="dataType" xsi:type="string">number</item> <item name="dataType" xsi:type="string">boolean</item> <item name="dataType" xsi:type="string">select</item> </item>

Hope this helps.

Was this page helpful?
0 / 5 - 0 ratings