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.
Problem/Motivation
Other contrib modules should be able to alter definitions of ShippingMethods trough hook, rather then depending on the module weight.
use Drupal\commerce_currency_resolver\Plugin\Commerce\ShippingMethod\FlatRateCurrency;
/**
* Implements hook_commerce_shipping_method_info_alter();
*/
function commerce_currency_resolver_commerce_shipping_method_info_alter(array &$definitions) {
$definitions['flat_rate']['class'] = FlatRateCurrency::class;
}
Proposed resolution
Add alter 'commerce_shipping_method_info' to \Drupal\commerce_shipping\ShippingMethodManager
Remaining tasks
None
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#2 | allow_altering_definition_shippingmethod_plugins-3082187.patch | 772 bytes | valic |
|
Comments
Comment #2
valicComment #3
valicComment #5
bojanz CreditAttribution: bojanz at Centarro commentedThanks! Every plugin type should always have an alter hook.