Hi all,

I have been experimenting lately with the hotel booking plug in for ubercart. I must say its pretty good and it kinda seems to be a complete booking system for hotel room reservations. Well done, good job and thanks for contributing this to the public.

Well to the point now. I would like to ask a couple of questions, i am still a newby with ubercart...and same goes for drupal. I want to add some additional information to the email templates sent when booking a room from the website. An example would be the order comments, the preferences (smoking non smoking), perhaps the dates the room was booked for , maybe the room description etc.

How can i do this?

In the hotel-booking.itpl.php where i presume the email is generated, there are a series of "tokens" like "[order-billing-address]". How can i find a list of the tokens that are available for use? And if there isnt such a thing how would i be able to bring extra information like that in the email template.

Thanks in advance for any suggestions/solutions to my problem

Comments

agapiou’s picture

Oh my god, i am so sorry. The minute i posted this issue the next minute i found out something so let me rephrase my issue.

admin/store/ca/uc_checkout_customer_notification/edit/actions

On the above path i found some tokens i am able to use like...order comments check in and out date which i am interested. i tried including them in the hotel-booking.itpl.php to see the results but it didnt work. Where am i supposed to use these tokens, i mean what is the overall procedure?

Also i am interested to display to the customers email some more information like the number of children he had selected the number of adults and the preference (meaning smoking or non smoking etc).

larowlan’s picture

Status: Active » Closed (fixed)

Hi
Ubercart 2.3 changed the way it deals with email templates.
Where previously they went via .itpl.php files, they now use regular Drupal theme templates.
As you mentioned you're new to Drupal - I'll give you a quick run down-
Modules define theme functions - these are typically prefixed with the word theme, eg theme_uc_product_image is a theme function used by the Ubercart product module to output images on the product page.
Any theme function can be overriden by the theme, the module suggests the recommended implementation but the theme can modify it. To modify a theme function your theme implements the same function replacing the word theme with the name of the theme. So if your theme is called acquia_prosper for example, you'd place a copy of theme_uc_product_image in the file template.php in your theme folder and call it acquia_prosper_uc_product_image and modify it as you need.
Similarly themed output can be generated via templates. This is what applies here, if you find files ending in tpl.php in a module, these can be overridden by your theme by copying the tpl.php file from the applicable module into your theme folder, refreshing your theme registry (clear all caches) and then you can safely modify the version in your theme folder.
This is how the invoice emails now occur with Ubercart 2.3. The itpl.php templates are a legacy item for earlier versions of Ubercart. So if you go to the uc_order folder inside the Ubercart module and find the templates folder - in there you'll find uc_order-customer.tpl.php - this it the email template - copy this into your theme folder, refresh your theme registry (clear caches) and you can then use these tokens in your version of the template.
More info can be found here: http://www.ubercart.org/docs/developer/17385/changing_invoice_templates_...
Lee