12 replies [Last post]
kulvik's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Cool profile pic award.Internationalizationizer
Joined: 08/14/2007
Juice: 336
Was this information Helpful?

Hi everyone.

Lately i've been doing a lot of upgrading of übercart installations. One of the things that "annoy" me is that I need to keep and copy the template files for the customer and admin emails. I know this sounds like a strange and somewhat unnessesary request, but we now have 12 übercart sites and this stuff is starting to become annoying/timeconsuming and a possible source for error as I might actually forget doing this Sticking out tongue

What if we defined a subdirectory in the theme folder where the store module can search for additional e-mail templates? We would then have this structure:

themes/garland/uc_templates

In this way people will still be able to download ubercart and use the default mail templates, while you give the possibility to have custom templates in the theme folder.

The ultimate goal for us is that upgrading übercart is simply a matter of:
1) Replace the entire ubercart folder.
2) Run update.php

Any cons?

Best regards,
Thomas Kulvik

Ny Media AS
www.nymedia.no
+47 4000 7955

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Tiny suggestion: E-mail templates

I don't see any cons... if there's any way you can patch this, I'd get it in as soon as it was tested. Otherwise I can try and get to it later this afternoon. Definitely a good idea. I was thinking something similar yesterday evening when writing the FAQ about updating your site.

kulvik's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Cool profile pic award.Internationalizationizer
Joined: 08/14/2007
Juice: 336
Good Give me a couple of

Good Smiling Give me a couple of working days and i'll submit a patch for you Smiling

Best regards,
Thomas Kulvik

Ny Media AS
www.nymedia.no
+47 4000 7955

psynaptic's picture
Offline
Early adopter... addicted to alphas.Not KulvikTheminator
Joined: 08/28/2007
Juice: 731
Re: Good Give me a couple of

Hi Kulvik, how are things going with this?

nickgs's picture
Offline
Joined: 02/25/2008
Juice: 113
Re: Re: Good Give me a couple of

This seems like a good feature to have!

Any word on a patch?

Thanks.

kulvik's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Cool profile pic award.Internationalizationizer
Joined: 08/14/2007
Juice: 336
Re: Re: Re: Good Give me a couple of

Hi guys. Just had another son so i've been spending a week in the hospital and taking care of mother and son. Patch coming soon Eye-wink

Best regards,
Thomas Kulvik

Ny Media AS
www.nymedia.no
+47 4000 7955

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: Re: Good Give me a couple of

Well, I was wondering if you had just died in a horrible dog sledding accident, but this is quite the opposite! Congratulations! Laughing out loud

psynaptic's picture
Offline
Early adopter... addicted to alphas.Not KulvikTheminator
Joined: 08/28/2007
Juice: 731
Re: Re: Re: Re: Good Give me a couple of

Congrats man!

kulvik's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Cool profile pic award.Internationalizationizer
Joined: 08/14/2007
Juice: 336
Thanks Sledding dogs uh?

Thanks Smiling

Sledding dogs uh? lol. not every norwegian in the world have that privilege. I have to walk with snowshoes to work. Have you seen the ending of the movie "The day after tomorrow"?. That's me walking to work...

hanoii's picture
Offline
Joined: 07/30/2008
Juice: 103
Re: Tiny suggestion: E-mail templates

Just got the point of where I should theme the invoice and noticed the current place for doing it is editing the files on the module itself and looking through the site I got here..

I would say this patch was never made, was it? Anyway, I don't mind doing so if it's still necessary. I have one question though, and why the templating is done this way instead of using a normal theme('xxx') drupal function so that can be easily overridden in any theme. I would think that a small change to ubercart to have a theme('xxx') function but still use the whole logic around the .itpl.php files could be useful.. any comments?

a.=

psynaptic's picture
Offline
Early adopter... addicted to alphas.Not KulvikTheminator
Joined: 08/28/2007
Juice: 731
Ideas

We need a way to define different itpl.php files, the web interface would work fine for that. Then we need to either have a theme function that points to the itpl.php files or a web interface that allows entering of paths for the itpl.php files. The main downside to having .tpl.php files in the module folder itself is when updating you may forget to copy the files out and back in.

I love the way with views you have a theme wizard to help you with the names of the fields. I usually have a single theme_views_view_list function that switches on the name of the view. It's also so useful to be able to dump the node object (or use dev render) to see what fields you can use. Something like this would make creating invoice templates much nicer.

Maybe I'm being shortsighted as it's been a long time since I made an invoice template (it was a pain last time I checked).

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Ideas

D6 brought with it the ability to have module based .tpl.php files that can be overridden at the theme layer. I believe this will solve some issues with the templating system the way it is right now, but it might make it harder to have multiple variations of a template.

fwiw, you actually don't need to hack the core .itpl.php to alter your template. My recommendation in the docs is to copy the file and rename/modify the copy instead.

totsubo's picture
Offline
Joined: 11/12/2009
Juice: 163
Re: Re: Ideas

Any chance we have a templating system for Ubercart mails yet?