Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is there a way to add the Payment method details to the invoice template? I have looked for clear and concise instructions on this and have not found anything.
Comments
Comment #1
TR CreditAttribution: TR commentedThe payment method is already listed on the invoice, were you looking for something other than that?
Payments for an order may be obtained using the API function uc_payment_load_payments($order_id), which returns an array of payments for that order with array elements corresponding to the columns in the {uc_payment_receipts} table.
Comment #2
esquareddesign CreditAttribution: esquareddesign commentedYes, with the payment method "Other" you can enter a description. The description field shows up when you chose the payment method "Other" and shows up when you view the order online but does not show up on the emailed invoice.
Example:
Payment method is set to: Other
Payment method description: Use credit card on file
Payment method "Other" shows up on the emailed invoice but the description does not.
Comment #3
TR CreditAttribution: TR commented$description = db_query('SELECT description FROM {uc_payment_other} WHERE order_id = :id', array(':id' => $order->order_id))->fetchField();
Comment #4
esquareddesign CreditAttribution: esquareddesign commentedThan you, that work wonderfully.