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.
In my opinion it is bad practice to modify uc_order/templates/*, for the same reasons as hacking core. I propose allowing themes to provide replacement and additional templates, instead of placing them inside the uc_order module directory.
Comment | File | Size | Author |
---|---|---|---|
#4 | ubercart-520478-4.patch | 1.76 KB | cedarm |
#3 | ubercart-520478-3.patch | 1.26 KB | cedarm |
ubercart_template_theme_override.patch | 1.75 KB | cedarm | |
Comments
Comment #1
andreiashu CreditAttribution: andreiashu commentedHi cedarm,
Please go to this issue and try to contribute there: #295423: Move invoice templates to module based .tpl.php files.
Marking this as duplicate.
Comment #2
cedarm CreditAttribution: cedarm commentedGrr. That patch is complicated by other motives. I'll post a note there though.
Comment #3
cedarm CreditAttribution: cedarm commented[edit] Ignore this patch.
Comment #4
cedarm CreditAttribution: cedarm commentedCouldn't wait for the other issue and went live with a new site using the original patch. Later we found that the order invoices in the store admin weren't using our custom templates in the theme because $theme wasn't yet initialized. Added init_theme() before code that uses $theme.
Note: path_to_theme() can't be used because we're calling uc_order_load_invoice() from a theme function.
Comment #5
joachim CreditAttribution: joachim commentedThis is a nice quick hack while waiting for that other issue to land.
It's worth mentioning that the faux-template files have to be in YOURTHEME/uc_order_templates/ to be found.