Let's learn to customize the Ubercart 2 purchase confirmation email based on product. Modifying the message is fairly straightforward, though not the most user-friendly in a Drupally sense.
What I needed was a way to customize text on the email based on what products had been purchased. I imagine this could be something added later to the node itself so that each product could have it's own text blurb added to the email when purchased, or if related to a purchased product, however I needed a quicker solution.
In your file structure find modules/ubercart/uc_order/templates/customer.itpl.php for editing. At the top of the template add something like:
<?php foreach ($order->products as $product2) {
if ($product2->nid == 52) { $flag1 = 1; }
if ($product2->nid == 53) { $flag2 = 1; }
}
?>
You will of course need the "nid" of whatever your product nodes are. An example of this usage would be if you had a sporting goods store that sold products as well as training events like baseball camps. You could use something like this to check to see if the user had purchased a baseball glove and then insert a blurb into the email about upcoming baseball training camps.
In my case I was selling events and wanted a way to remind the user of the directions to the event. Since the events could be held in different buildings and/or rooms we needed to provide text based on the event.
L. F., Managing Partner HingeJohn has worked on several projects for us and is very consistent and reliable. He is obviously talented on the technical side but what stands out is his ability to deliver what he says he will deliver when he says he will. In the IT world that says a lot.
Post new comment