How would one display the order's referral source information in an invoice.

Comments

plasticlax’s picture

is there a list of tokens or variables available in the invoice?
i used

dprint_r($order);

in the invoice but i don't see any referral source information in that array. (that is how the old Lead Tracker module worked).

adamo’s picture

Referral source information does get added to the $order object during the 'load' op of hook_ubercart_order(). You should be able to get to it like so:

// ID of selected Referral Source
$rid = $order->referralsource['rid'];
// "Other" text entered
$other = $order->referralsource['other'];

I'll see about getting tokens created for these values and for the name and code of the referral source selected.

adamo’s picture

Assigned: Unassigned » adamo
Status: Active » Fixed

Tokens have been added for Ubercart orders. They are:

[referralsource_selection_rid] ID of referral source selection.
[referralsource_selection_title] Title of referral source selection.
[referralsource_selection_code] Code of the referral source selection.
[referralsource_other] Referral source "Other" text.

Commited to CVS, will be in the next dev snapshot.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

chadhester’s picture

I would love to start using this feature in my invoices, and in a protected space on the user's account page (for user reg results). I know that the later is likely a separate issue.

Are tokens ready for use in the current stable version? If not, should these be expected in the next stable release? Lastly, to make things safer from direct database calls, I think it would be wise to include the "selection title" in the $order object.

My company would like me to expose an individual's response on their account page (also perhaps an admin email announcing the new user), and on the invoices that the admin receives. I can contribute code back when I'm done, but just wanted to collect information about this before I get started.

Thanks for any input.

UPDATE: Created a new Issue here http://drupal.org/node/835072