6 replies [Last post]
f2stop's picture
Offline
Joined: 01/21/2008
Juice: 43
Was this information Helpful?

I need to add our Paypal transaction ID number to our admin receipt (admin.itpl.php) so our staffers can easily match orders to Paypal payments. I just spent 90 minutes on the Ubercart site searching for a list of available tokens and can't find anything.

I'm pretty sure I just need to add another line to this area of the admin template:

<?php
echo t('Order number:');
?>

[order-admin-link]

<?php
echo t('Customer:');
?>

[order-first-name] [order-last-name] - [order-email]

<?php
echo t('Order total:');
?>

[order-total]

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

[order-shipping-method]

The transaction ID is visible in the Ubercart Payments page (in the Comment column), so I should be able to use it in the receipt, right?

What do I need to add, and where can I find a list of available tokens for the next time I need to add info to the template?

rennsix's picture
Offline
Uber Donor
Joined: 09/11/2008
Juice: 89
Re: Where can I find a list of available Order tokens?

Have you checked here?

Navigate to Store Administration and click the Conditional Actions tab (admin/store/ca/)

Then under the Trigger: Customer completes checkout you will see "E-mail admin checkout notification". Under the Operations column click EDIT
This link works too (admin/store/ca/uc_checkout_admin_notification/edit)

Continue by clicking the "Actions" tab at the top, the last choice of three.

Click the "Action: Email an order invoice" and the pane will expand.

Under "Subject" there is Replacement Patterns.

Click that and you will be supplied with all of the order tokens as well as the global tokens.

Hope that helps
-Colin

f2stop's picture
Offline
Joined: 01/21/2008
Juice: 43
Thank you!

Thanks! I think that'll do it!

rennsix's picture
Offline
Uber Donor
Joined: 09/11/2008
Juice: 89
Re: Thank you!

I forgot you can see them here as well. Order and Global

/admin/store/help/tokens

Scott M. Sanders's picture
Offline
Joined: 04/24/2009
Juice: 323
Re: Re: Where can I find a list of available Order tokens?

This helped me too; thanks guys.

But I think "Replacement Patterns" and "Tokens" sound like two very different things.

ibtimmons's picture
Offline
Joined: 07/27/2010
Juice: 6
How I did this

realize this post is dated, but didn't see token for getting the paypal transaction id so this is what I did:

in /sites/all/modules/ubercart/uc_order/uc_order.module find function uc_order_token_values() & add this after $order = $object;

/**
* get the paypal transaction id
*/

$query = db_query("SELECT o.data FROM {uc_payment_receipts} o WHERE o.order_id=%d", $order->order_id);
$ppdata = unserialize(db_result($query));
$values['paypal-id'] = $ppdata['pnref'];

Then in /sites/all/modules/ubercart/uc_order/templates/admin.itpl.php (or a custom one you may have created) add:

<?php echo t('Paypal Transaction ID:'); ?> [paypal-id]
deanloh's picture
Offline
Joined: 08/20/2007
Juice: 27
Re: How I did this

Trying my luck for a response (since this was posted so long ago...)

I followed this method and I got a blank value:
i.e. Paypal Transaction ID: {blank}

I looked at the table: uc_payment_receipts, the data column appears to be empty, the PayPal transaction ID is instead stored in column: comment. Therefore I tried change the query to:
$query = db_query("SELECT o.comment FROM {uc_payment_receipts} o WHERE o.order_id=%d", $order->order_id);

But that didn't seem to work either. Am I missing something here?