Closed
Description
Preconditions (*)
- Magento 2.3.4 with Sample data
- A module that declares a custom attribute for as per instructions from dev docs (https://devdocs.magento.com/guides/v2.3/howdoi/checkout/checkout_new_field.html#add)
Steps to reproduce (*)
- Install a module that adds a custom address attribute (either follow the dev docs to create your own or install the module below)
- Enable and Redeploy site
- Add item to cart and proceed to shipping step of checkout
- Fill out shipping information (custom attribute + address data)
- Select a shipping rate
- Navigate back to your cart
- Trigger a estimate shipping event
- Either try to use shipping estimator on the cart with a new postcode
- Or continue back to checkout and change postcode
Expected result (*)
- Pull through shipping rates for the new postcode
Actual result (*)
- https://www.youtube.com/watch?v=cy3gQqQZ0fs
- Estimate shipping methods request returns a 400 bad request with the following error message
{"message":"Error occurred during \"custom_attributes\" processing. A custom attribute is specified with a missing attribute code. Verify the code and try again."}
Due to strange nesting within the custom_attribute property. Originally while its working the address payload is of the following format
custom_attributes: [{
"attribute_code": "custom_field",
"value": "123"
}]
Where was when we are getting 400 errors the custom attributes looks like so
custom_attributes: [{
"attribute_code": "0",
"value": {
"attribute_code": "custom_field",
"value": "123"
}
}]
Currently using the following Hotfix to allow for checkout
https://gist.github.com/SamJUK/479ca3f108b8091fbf512695f97363fb
Additional information
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.3 release lineThe issue has been fixed in 2.4-develop branchGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentA defect with this priority could have functionality issues which are not to expectations.Indicates original Magento version for the Issue report.The issue has been reproduced on latest 2.3 releaseAffects critical data or functionality and forces users to employ a workaround.Has been reviewed and prioritized during Triage with Product Managers
Type
Projects
Status
Done