Quantcast
Channel: drupal.org - Site administrators
Viewing all articles
Browse latest Browse all 426

Displaying extra fields in invoice template

$
0
0

By default, Extra Fields Pane field's values are not displayed in the invoice that get's send by Ubercart. To let values of extra fields show up in the customer invoice mail, you need to edit the customer invoice template and add the extra fields variables in there.

This document describes how a field variable is called for Extra Fields Pane versions 7.x-1.x and 6.x-2.x. The 7.x-1.x version uses an other pattern than the 6.x-2.x version.

Extra Fields Pane 7.x-1.x

For the 7.x-1.x version of Extra Fields Pane, each field variable uses the following pattern:

$uc_addresses_(address type)_(field name)
  • '(address_type)' can be 'delivery' or 'billing'.
  • '(field name)' is the machine name of your field, for example 'ucxf_gender'.

So, if for example your extra field is called 'gender', then these variables will be available for the Ubercart invoice template:

  • $uc_addresses_delivery_ucxf_gender;
  • $uc_addresses_billing_ucxf_gender;

Steps:

  1. Copy the template 'uc-order--customer.tpl.php' to your theme (the template can be found in ubercart/uc_order/templates).
  2. Edit the template uc-order--customer.tpl.php, add variables of extra fields to it (i.e. $uc_addresses_delivery_ucxf_gender).

Extra Fields Pane 6.x-2.x

For the 6.x-2.x version of Extra Fields Pane, each field variable uses the following pattern:

$extra_(pane_type)_(field name)
  • '(pane_type)' can be 'extra_delivery', 'extra_billing' or 'extra_information'.
  • '(field name)' is the machine name of your field without the 'ucxf_' prefix, for example 'gender'.

So, if you have an address field that's called 'gender', then these variables will be available for the Ubercart invoice template:

  • $extra_extra_delivery_gender;
  • $extra_extra_billing_gender;

And if you have a custom field that's called 'your_reference', then this variable will be available for the Ubercart invoice template:

  • $extra_extra_information_your_reference;

Steps:

  1. Copy templates uc_order-customer.tpl.php and uc_order.tpl.php to your theme (the templates can be found in ubercart/uc_order/templates).
  2. Edit the template uc_order-customer.tpl.php, add variables of extra fields to it (i.e. $extra_extra_delivery_gender).

Viewing all articles
Browse latest Browse all 426

Trending Articles