5

I used magento2.3 - when i go to checkout page this error comes below.please if anyone know regarding this reply me

Error occurred during "shipping_address" processing. Error occurred during "customAttributes" processing. A custom attribute is specified with a missing attribute code. Verify the code and try again.
4
  • Did you have any customization in checkout steps? Special for Shipping Address or Billing Address. Is there any custom field for Billing or Shipping Address? May 28, 2019 at 10:54
  • Yes I have to add customer attribute "Suite".
    – Rv Singh
    May 28, 2019 at 10:57
  • Hi @RvSingh, did you solve it? Aug 1, 2019 at 5:50
  • any update on this Nov 15, 2019 at 14:17

2 Answers 2

0

This should be fixed by this commit https://github.com/magento/magento2/commit/c15e194a9c5395d6cc703813feea8ed6efc4f6d5#diff-5caf9b4a7016097c6254817ce41d982e

The problem was that it was using 0, 1, etc. as keys and 0 evaluates to false in the PHP.

0

You can fix this by creating the extension attributes.If you have already created then you have missed a change in the js file

Vendor_Name/Module_Name/view/frontend/web/js/action/set-shipping-information-mixin.js

define([
    'jquery',
    'mage/utils/wrapper',
    'Magento_Checkout/js/model/quote'
], function ($, wrapper,quote) {
    'use strict';

    return function (setShippingInformationAction) {
        return wrapper.wrap(setShippingInformationAction, function (originalAction, messageContainer) {

            var shippingAddress = quote.shippingAddress();

            if (shippingAddress['extension_attributes'] === undefined) {
                shippingAddress['extension_attributes'] = {};
            }

            if (shippingAddress.customAttributes != undefined) {
                $.each(shippingAddress.customAttributes , function( key, value ) {

                    if($.isPlainObject(value)){
                        value = value['value'];

                   // assign value to key ..add this if you have missed
                        key = this.attribute_code;
                    }

                    shippingAddress['customAttributes'][key] = value;
                    shippingAddress['extension_attributes'][key] = value;

                });
            }

            return originalAction(messageContainer);
        });
    };
});

Hope it helps. Happy Coding !!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.