I had trouble getting the gift order template to be sent from the system. I copied it into the correct ubercart themes directory as instructed, but no luck.

Looking through the code I saw this starting on line 107:

/**
 * Implementation of hook_uc_invoice_templates().
 */
function uc_gift_order_uc_invoice_templates() {
  return array('gift_order');
}

I believe it should read this:

/**
 * Implementation of hook_uc_invoice_templates().
 */
function uc_gift_order_uc_invoice_templates() {
  return array('gift_message');
}

Where 'gift_order' is changed to 'gift_message' to match up with the naming convention on the .tpl.php file included in the module. I suppose you could also change the name of the template file, but this is the way I did it.

Hope this helps.

CommentFileSizeAuthor
#2 uc_gift_order.patch431 bytesnathanjo

Comments

nathanjo’s picture

True. The code is mismatch with the template file. This should be fix.
I find it easy just to change the template filename to uc_order-gift_order.tpl.php when copying to uc_order/templates

nathanjo’s picture

StatusFileSize
new431 bytes

Attached patch that change return array('gift_order') to return array('gift_message').

tomw’s picture

Hi,
Thanks for sharing the patch, it was my prefered solution.

----
Just to provide the feedback if needed for others.

In order to make the change on line #107 work as mentioned above, I also had to change line 207 from:
$output = theme('uc_order', $order, 'print', 'gift_message');

to:
$output = theme('uc_order', $order, 'print', 'gift_order');

----

But the patch takes care of it and hopefully it will make it into the next release.
Tom