cancel
Showing results for 
Search instead for 
Did you mean: 

How to get extra shipping address attributes into the estimate rate request code?

How to get extra shipping address attributes into the estimate rate request code?

I need to use extra shipping attributes on the estimate shipping post request that gets sent through as a RateRequest to carriers/shipping modules.

 

Steps to reproduce:

  1. Add an extra shipping attribute.
  2. Add/Create a shipping module.
  3. Output the contents of RateRequest object in your shipping module.
  4. It will not have the extra attribute in it.


There must be some way to modify the JS to send an extra attribute (new-customer-address.js).
And to modify the PHP to put that attribute into the RateRequest object when using existing address or new address.

I have modified the new-customer-address to a new file using requirejs-config.js

 

  "map": {
  	"*": {
  		"Magento_Checkout/js/model/shipping-rate-processor/new-address": "AddressFinder_AddressFinder/js/new-address"
  	}
}