Hi,
You need to base your plugin out of another shipping plugin like usps.
You need only two things from it:
- define an attribute $pluginConfig with the information for your option (you can see how extra fields can be added in the usps plugin code.
- implement the onShippingDisplay function, and in it, first call the parent function of the same name and then loop through the shipping methods and do your checks in $order->products based on what you have in your shipping methods extra options. You can look for example at how weight_approximation and dim_approximation are handled in that function of the usps plugin.