Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There's a patch in commerce_flat_rate issue queue that lets store administrator to select default flat rate shipping service that will be presented to the user here #1612702: Add support for default flat rate service.
Patch in comment makes this happen.
Comment | File | Size | Author |
---|---|---|---|
#3 | commerce_shipping-1612706-3_support-for_default_shipping.patch | 1.92 KB | kotnik |
#1 | commerce_shipping-1612706-1_support-for_default_shipping.patch | 1.86 KB | kotnik |
Comments
Comment #1
kotnik CreditAttribution: kotnik commentedPatch attached.
Comment #2
googletorp CreditAttribution: googletorp commentedThat code won't work for multiple shipping services.
Comment #3
kotnik CreditAttribution: kotnik commentedYes, but it will ignore shipping services that do not support them.
PS. Patch attached fixes the case when line item already has shipping set.
Comment #4
googletorp CreditAttribution: googletorp commentedThe problem is, that it's pretty random what value is chosen as default value, since it will be whatever shipping service that is loaded last which will determine the default value. I haven't looked closely into the code, but it's clear that this needs work.
Comment #5
kotnik CreditAttribution: kotnik commentedIt most definitely does.
This is solid only if one is using flat rate service with the patch from #1612702: Add support for default flat rate service.
But I guess there's a need for an option like this.
Comment #6
googletorp CreditAttribution: googletorp commentedI'm not sure if this is a good idea or not - but seeing that no one is willing to work on this and I'm not sure about it I'm going to mark this as won't fix.
It would be easy with form alter to set a default option. I believe the the first method in the list is treated as a default option anyways - so being able to set the order would fix this anyways.
If anyways feel like it would be better to do something like this and provide a better patch or talk about it - feel free to reopen the issue or create a new.