0

{"message":"Error occurred during \"shipping_address\" processing. Error occurred during \"street\" processing. Invalid type for value: \"string\". Expected Type: \"string[]\".","trace":null}

Getting above error when i'm trying to set shipping address in shipping.js file.

shipping.js

setShippingInformation: function () {

                    //alert('trtrt'); 
                        var shippingAddress = quote.shippingAddress();
                        shippingAddress.firstname = 'gggg';//$('[name="pickup_name"]').val();
                        shippingAddress.lastname  = 'hhhhh';//$('[name="pickup_lastname"]').val();
                        shippingAddress.street    = 'Abcd street';//new Array(place.street);
                        shippingAddress.city      = 'Los Angeles';//place.city;
                        shippingAddress.countryId = 'US';//place.country_id;
                        shippingAddress.telephone = '1234512345'; //+place.telephone;
                        shippingAddress.region  = "illionis";
                        shippingAddress.regionId  = "12";
                        shippingAddress.postcode  = '45454';//place.postcode;

                        selectShippingAddress(shippingAddress);
                        quote.shippingMethod('mpcustomshipping');

                        selectShippingMethodAction('mpcustomshipping');


                        setShippingInformationAction().done(
                                function () {
                                    stepNavigator.next();
                                }
                        ); 
            },

rest/default/V1/guest-carts/f3fea8d0bef3344599bfc3467da43139/shipping-information

<response>
<message>Request does not match any route.</message>
<trace/>
</response>
0

shippingAddress.street is an array and you are passing to the string that's why it gives the error, Try to pass the value as an array shippingAddress.street = ['Abcd street']

enter image description here

  • now it gives this error: "message":"Carrier with such method not found: %1, %2","parameters":[null,null], – Jimit Bhavsar Jan 2 at 14:11
  • This means that It will resolve the error which you posted in question and now you have a different error, please check you have mpcustomshipping shipping method is enabled or not and you have this shipping method or not – Keyur Shah Jan 2 at 14:13
  • yes, i have approved your answer – Jimit Bhavsar Jan 2 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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