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
We cannot override commerce_line_item_manager theme to add custom rows because everything is set in theme function which return markup generated in function.
This is painful if we need to add custom values by line items in back-office (example, a delivery date by line item).
Proposed resolution
I suggest to switch this function to a preprocess + template so it will be overridable by drupal processes.
Comment | File | Size | Author |
---|---|---|---|
#2 | commerce-line-item-manager-2834739-2.patch | 3.09 KB | GoZ |
Comments
Comment #2
GoZ CreditAttribution: GoZ at Centarro commentedComment #3
rszrama CreditAttribution: rszrama at Centarro commentedHmm, my only worry is backwards compatibility. This shouldn't break any current overrides, right? Since the theme function itself would be overridden in total?
Comment #4
GoZ CreditAttribution: GoZ at Centarro commentedThe only way to currently override theme function is to override
$theme_registry['commerce_line_item_manager']['function']
in hook_theme_registry_alter() with something like that :Patch add a way to override theme with preprocess + template, which remove the current
$theme_registry['commerce_line_item_manager']['function'] ( = 'theme_commerce_line_item_manager')
entry from $theme_registry.But if your previous hook_theme_registry_alter() previously added your custom function, this function will still be called as final result and will not take care of processed preprocess functions since it will return something.
So i don't think patch will break existing overrides.