19 replies [Last post]
Vincent at KIM's picture
Offline
Joined: 09/09/2011
Juice: 35
Was this information Helpful?

Hi there ...

Could someone please help to get the order comment into the mail-notifikation for the admin (uc_order-admin.tpl.php).
I´ve got managed to get the Shipping method into the template of the notifikation,what wasn´t there by default (just in order-customer), but now I need the comments added there too.
The comment is displayed in the invoice on the website, but should also be shown in the mail-invoice.

For the shipping method it says:

<?php
echo t('Shipping method:');
?>
<?php
echo $order_shipping_method;
?>

something like that I would expact here too:

<?php
echo t('Order Comment:');
?>
<?php
echo $order_comment;
?>

=not working!

Why does the the comment show up (by default) at the website-invoice and not at the mail?

I´ve read the discussions concerning this topic, but most are very old. I´m no programmer, I wasn´t able to adapt the advices there for my needs.

Any hint?

Vincent

make-online-shop's picture
Offline
Joined: 01/01/2011
Juice: 511
Re: How to add the order comments to the invoice (order_admin)

Yes, it would be interesting to know.

Thanks.

Vincent at KIM's picture
Offline
Joined: 09/09/2011
Juice: 35
order comment in the mail-notifikation

nobody? no idea?

is that so complicated ... or stupid simple?

regards
Vincent

george@dynapres.nl's picture
Offline
Joined: 01/02/2008
Juice: 241
Re: How to add the order comments to the invoice (order_admin)

There doesn't seem to be a variable available for this. Working on a solution.

---
George on Drupal

george@dynapres.nl's picture
Offline
Joined: 01/02/2008
Juice: 241
Re: How to add the order comments to the invoice (order_admin)

You'll probably have to develop a custom module to add variables for use with the invoice template. Look at uc_bank_transfer for an example how to do this.

---
George on Drupal

Vincent at KIM's picture
Offline
Joined: 09/09/2011
Juice: 35
Re:How to add the order comments to the invoice (order_admin)

Thank you for the information

To write a custom modul is not really a good alternative solution for me Eye-wink

The reason why I am asking for is, that the notification-mail for an order goes to an external contributor who doesnt have automatically access to the shop-administration to check if there is a comment set by the customer.

Nevertheless the shop modul is working fine on our site (to mention that by the way Smiling

regards

Vincent

persianninja's picture
Offline
Joined: 06/10/2011
Juice: 38
Re: How to add the order comments to the invoice (order_admin)

I was requested to do this recently as well...

The admin email has this variable right (uc_order-admin.tpl.php)?

<p>
<?php echo t('Order comments:'); ?><br />
<?php echo $order_comments; //original post had singular $order_comment  so maybe thats why not showing up? ?>
</p>

why wouldnt that variable be available for the customer email (uc_order-customer.tpl.php)? is it as simple as adding that?

Im not sure what would be in that comment, the 'Payment of XXX.00 USD submitted through PayPal.' comment or the user submitted comment if it is available to use in the customer email.

OriginalSauce's picture
Offline
Joined: 08/30/2011
Juice: 77
persianninja wrote: I was
persianninja wrote:

I was requested to do this recently as well...

The admin email has this variable right (uc_order-admin.tpl.php)?

<p>
<?php echo t('Order comments:'); ?><br />
<?php echo $order_comments; //original post had singular $order_comment  so maybe thats why not showing up? ?>
</p>

why wouldnt that variable be available for the customer email (uc_order-customer.tpl.php)? is it as simple as adding that?

Im not sure what would be in that comment, the 'Payment of XXX.00 USD submitted through PayPal.' comment or the user submitted comment if it is available to use in the customer email.

I can confirm that the order comments token is available. The original poster missed off the (s) which persianninja pointed out.

It should be

$order_comments;

as shown above

Vincent at KIM's picture
Offline
Joined: 09/09/2011
Juice: 35
Hallo, thanks for this hint.

Hallo,
thanks for this hint. I´ve overlooked that advice in the post by persianninja.
I´ll try it once again Smiling

regards

Vincent

persianninja's picture
Offline
Joined: 06/10/2011
Juice: 38
Re: persianninja wrote: I was

Cool OriginalSauce, thanks for confirming as my client couldn't send me any emails from any customers who posted comments (and testing this email/paypal stuff locally on Windows box is a hassle, at best I test via paying with the paypal developer site, and finish my testing there unfortunately for now. Maybe a better way to test paypal/email with DynDNS stuff pointing to my box and having email server setup on windows [or exim]).

Btw, ubercart needs to get on top of spam. This thread was updated past couple times by spambots. Mollom seems to be letting some through.

Vincent at KIM's picture
Offline
Joined: 09/09/2011
Juice: 35
$order_comments;
OriginalSauce][quote=persianninja wrote:

I

<p>
<!--?php echo t('Order comments:'); ?--><br />
<!--?php echo $order_comments; //original post had singular $order_comment so maybe thats why not showing up? ?-->
</p>

It should be

$order_comments;

as shown above

Still no success with the code from above

What could be wrong here?:

<p>
<!--?php echo t('Order number:'); ?--> <!--?php echo $order_admin_link; ?--><br />//correctly printing
<!--?php echo t('Customer:'); ?--> <!--?php echo $order_first_name; ?--> <!--?php echo $order_last_name; ?--> - <!--?php echo $order_email; ?--><br />//correctly printing
<!--?php echo t('Order total:'); ?--> <!--?php echo $order_total; ?--><br />//correctly printing
<!--?php echo t('Shipping method:'); ?--> <!--?php echo $order_shipping_method; ?-->//correctly printing
<!--?php echo t('Order comments:'); ?--><br />//NOT printing
<!--?php echo $order_comments; //original post had singular $order_comment so maybe thats why not showing up? ?-->
</p>

thanks for any advice

Vincent

p-s- I´m editting: /sites/all/modules/ubercart/uc_order/templates/uc_order-admin.tpl.php ... is that the right one? ...should be because I already managed to get the "shipping method" printed
p.p.s there´s something wrong with the display of the code inside the code tags above in this post, sorry

OriginalSauce's picture
Offline
Joined: 08/30/2011
Juice: 77
Vincent at
Vincent at KIM][quote=OriginalSauce wrote:
persianninja wrote:

I

<p>
<!--?php echo t('Order comments:'); ?--><br />
<!--?php echo $order_comments; //original post had singular $order_comment so maybe thats why not showing up? ?-->
</p>

It should be

$order_comments;

as shown above

Still no success with the code from above

What could be wrong here?:

<p>
<!--?php echo t('Order number:'); ?--> <!--?php echo $order_admin_link; ?--><br />//correctly printing
<!--?php echo t('Customer:'); ?--> <!--?php echo $order_first_name; ?--> <!--?php echo $order_last_name; ?--> - <!--?php echo $order_email; ?--><br />//correctly printing
<!--?php echo t('Order total:'); ?--> <!--?php echo $order_total; ?--><br />//correctly printing
<!--?php echo t('Shipping method:'); ?--> <!--?php echo $order_shipping_method; ?-->//correctly printing
<!--?php echo t('Order comments:'); ?--><br />//NOT printing
<!--?php echo $order_comments; //original post had singular $order_comment so maybe thats why not showing up? ?-->
</p>

thanks for any advice

Vincent

p-s- I´m editting: /sites/all/modules/ubercart/uc_order/templates/uc_order-admin.tpl.php ... is that the right one? ...should be because I already managed to get the "shipping method" printed
p.p.s there´s something wrong with the display of the code inside the code tags above in this post, sorry

You can edit the template at /sites/all/modules/ubercart/uc_order/templates/uc_order-admin.tpl.php. I've made a copy of the template file and placed it in my theme folder. It's easier to manage from there.

I'd recommend making a copy of uc_order-admin.tpl.php and uc_order-customer.tpl.php and moving to your theme folder. Make sure you also put a copy of uc_order.tpl.php in the theme folder, flush cache and you set to go.
It will override the default templates in the module and use these instead.

You can even create a custom template. Aslong as it sticks to the format uc_order-my-custom-invoice-template.tpl.php, (*my-custom-invoice-template* being anything you like) it will be available as a template.

The above code is this actually how your snippet of code looks in the template?

As an example this is mine

<tr>
   <td nowrap="nowrap">
        <b><?php echo t('Order Comments:'); ?></b>
   </td>
    <td width="98%">
          <?php echo $order_comments; ?>
     </td>
</tr>

One thing you can check is what tokens are available to you. go to /admin/store/help/tokens and this will provide you with your available tokens.

OS

Vincent at KIM's picture
Offline
Joined: 09/09/2011
Juice: 35
Still no success ...

thanks for posting this detailed instruction, I followed it exactly, but still no success.
A strange fact is, that in the meanwhile I have another Ubercart-Installation on another site and there the comment is displayed as expected.
Difference is , that the notification-mail there comes as plain text, on the problem-site the mail is in html.
Now I dont find where to change the format.

This path, as suggested in another threat:
http://www.yoursite.com/admin/store/settings/notify/edit/checkout
doesnt work, opens just the settings-overview
(I have the UC-installation in german .. but I guess this shouldnt matter)

regards
Vincent

make-online-shop's picture
Offline
Joined: 01/01/2011
Juice: 511
Re: Vincent at

Drupal 6 Comment in invoice Ubercart shop

Hello,

Do you know that it could work with Drupal 6 Ubercart 2 ?

Thank you.

Vincent at KIM's picture
Offline
Joined: 09/09/2011
Juice: 35
order_comment in admin-notification mail - solved

Hi,

I had wrong settings at:
/admin/store/ca/uc_checkout_admin_notification/edit/actions

there was the customers-template selected instead of the non-html admin template.

Now the comments are displayed correctly in the admin´s notification mail.

Thanks to all for help

Vincent

John Callanan's picture
Offline
Joined: 11/14/2012
Juice: 3
Close but not quite working

I managed to get the comments field to show up in the invoice, but it is not pulling the comment data in. It just displays "No comments left" even though there are comments in the order. I used the code snippets above, so not sure why it's not working. Any ideas?

DrCord's picture
Offline
Joined: 11/18/2013
Juice: 13
Drupal 7 Shipment Tracking Tokens Module available

I created and contributed a module for shipment tracking tokens in Drupal 7. https://drupal.org/sandbox/drcord/2138485

It works fine, on use to send an email you see warnings in the Drupal order admin, but that issue is in resolution.

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3275
Re: Drupal 7 Shipment Tracking Tokens Module available

It would be really helpful if you could post this as a patch for Ubercart in the Ubercart issue queue at https://drupal.org/project/issues/ubercart rather than as a sandbox project. That way it can be evaluated and incorporated into Ubercart core.

<tr>.
DrCord's picture
Offline
Joined: 11/18/2013
Juice: 13
Issue created, now onto the patch :D
DrCord's picture
Offline
Joined: 11/18/2013
Juice: 13
Patch created

The patch is uploaded to the issue.

https://drupal.org/node/2139337