Code present in the invoice .tpl.php files such as
if (is_array($product->data['attributes']) && count($product->data['attributes']) > 0) {
should be moved to a template preprocess function, and the results included directly as printable template variables, or set up in a suitable way for a subsequent theme() call to deal with; this would make it much easier for designers to create and modify store invoices without understanding PHP or worrying about breaking it.

CommentFileSizeAuthor
#1 998542-preprocess-invoice.patch22.16 KBlongwave

Comments

longwave’s picture

Status: Active » Needs review
StatusFileSize
new22.16 KB

Patch attached that moves the complicated parts out of the templates into the preprocess function and replaces 'echo' with 'print' and closing braces with endif/endforeach for better readability.

longwave’s picture

Status: Needs review » Fixed

Made several commits that implement this. We could probably go further and split out product rendering into its own function, move attribute rendering into uc_attribute.module, etc. but this will do for now.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.