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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andreiashu’s picture

Status: Needs review » Closed (duplicate)

Hi 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.

cedarm’s picture

Grr. That patch is complicated by other motives. I'll post a note there though.

cedarm’s picture

FileSize
1.26 KB

[edit] Ignore this patch.

cedarm’s picture

FileSize
1.76 KB

Couldn'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.

joachim’s picture

This 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.