Skip to content

Can’t get Address custom attribute in custom shipping method collect rates

I’ve created new custom address attribute and able to save them in the quote_address and sales_order_address table, but i’ve found bug when i’m trying to get my custom attribute data from my custom shipping method in collect rate RateRequest function, i was trying to get the custom attribute data with $request->getCustomAttributes or $request->getCustomAttributesCodes but it always return null.

When i check the estimate-shipping-method body request, i can see my attribute is sent like below
enter image description here

So i was wondering should we override the Magento_Quote model/quote/address function, it’s because i see the SetDest function there
enter image description here

so my question is, what is the best way to get my custom attribute data from Rate Request function ?

I’m using Magento 2.4.3

Thank you