6 replies [Last post]
rickyw's picture
Offline
Joined: 02/02/2009
Juice: 51
Was this information Helpful?

I've modified the invoice template and it seems fine.
The problem is with the e-mail that it sends out, it doesn't display the $thank_you part like "Thank you so and so"
Even when I use the default customer template, the info doesn't show.
Perhaps I missed a check box to enable this?

The changes I made to the default template were very minor.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Thank you text on Invoice

Are you using $thank_you as a boolean in your invoice template? It shouldn't actually have a string in it.

rickyw's picture
Offline
Joined: 02/02/2009
Juice: 51
Re: Re: Thank you text on Invoice

Maybe I don't know how the templating system works exactly (I'm not an expert)
but with the basic customer template there is an if statement like
<? php if ($thank_you) { ?>
<? php echo t('text'); ?>
that is the text that doesn't show up

Obviously this isn't the proper code, but like I said, it's just lightly modified from the included template (changed some colors and spacing). There is similar text below that appears just fine, the "automated e-mail" message etc.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: Thank you text on Invoice

Looking at the function uc_order_load_invoice() in uc_order.module, I think I see why. Those variables are probably not getting set to TRUE based on where you're trying to get them to show up. It looks like only the invoice when sent automatically during checkout will have the thank you message. Also, make sure you're using $thank_you_message instead of just $thank_you. Do we have that documented improperly somewhere?

rickyw's picture
Offline
Joined: 02/02/2009
Juice: 51
Re: Re: Re: Re: Thank you text on Invoice

No, the documentation is fine, I just wrote it from whatever I remembered from looking at the template.
So I guess under the admin-mail case I should set $thank_you_message = TRUE?
How would I go about that without modifying the core module?
I know if it was a theme function then I can just throw it under template.php, but this isn't one of those...

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: Re: Re: Thank you text on Invoice

Just realized, what if instead of using the $thank_you_message variable you just compared against $view directly? if ($thank_you_message || $view == 'admin') in your invoice template.

rickyw's picture
Offline
Joined: 02/02/2009
Juice: 51
Re: Re: Re: Re: Re: Re: Thank you text on Invoice

I tried putting what you suggested in the template but it didn't seem to work. I'm no means a php expert though, so maybe I did something wrong?

In any case, I think it might just be too much trouble since it goes out automatically anyway.

I did modify the module file directly and things showed up as I wanted. I didn't bother keeping the changes though since upgrading would wipe them out anyway.

Thanks for your help