cancel
Showing results for 
Search instead for 
Did you mean: 

OPC - passing custom attributes when user is logged in

OPC - passing custom attributes when user is logged in

Hello,

 

I have added custom field to shipping-address-fieldset through my own LayoutProcessor plugin. When user is not logged in, this field is present in shipping address form and I can pass its value to next checkout step and then to the backend (extenstion_attributes). My custom field scope is set to: 

shippingAddress.custom_attributes

 The problem is when the user logs in and there's no shipping-address-fieldset item in layout (list of predefined addresses is shown) so if I need my field to display I need to declare it in another xml section for e.g. before-shipping-method-form. When I do so, my field value is not passed further (custom_attributes of shippingAddress are undefined). I guess it's because this scope only works if field is declared in shipping-address-fieldset section. I need to pass my custom field value to next checkout step and backend regardless if user is logged in or not. I'm using magento 2.2.1 CE.

Cheers