Problem/Motivation
Shipments can have additonal addon surcharges or services such as insurance, signature required, hazardous materials. Currently every shipping module must provide it's own implementation. This isn't a problem if you can roll the surcharge into the shipping service price. If you want user choice for addon shipping services you have to implement your own UI.
Use Cases
commerce_usps gets a quote for insurance and signature confirmation from the USPS API when requesting a rate quote. It includes these quotes as options on the shipping method
commerce_fedex has a surcharge for hazardous materials. The fedex module could display this surcharge with the shipping method instead of invisibly adding it the shipping method price
A freight module has optional addon services such as lift gate, packaging, etc which are displayed as options for the user to select from
Proposed resolution
Create an API that allows shipping service modules to define shipping price adjustments.
Each adjustment consists of three values: Label, Price, Optional
User interface changes
The label and price are displayed in the shipping pane next to each of the available shipping methods
If an adjustment is optional it is displayed below the selected shipping method. If a shipping method is selected by a user that has an optional adjustment then display a checkbox, the label, and the +price below the shipping method

| Comment | File | Size | Author |
|---|---|---|---|
| #4 | Screenshot from 2021-04-02 15-53-51.png | 32.76 KB | rhovland |
Comments
Comment #2
rhovlandrszrama:
Comment #3
rhovlandComment #4
rhovlandComment #5
jsacksick commentedI've been thinking about this lately, and I'm pretty sure we need shipment processors... And a ShipmentRefresh service (that is similar to OrderRefresh).
We need a refresh process for shipments... So that is part 1, and we probably need to allow shipping rates to have adjustments as well...
So if a rate is selected and has adjustment.
ShippingMethod::applyRate()should transfer adjustments to the shipment.