Hi,

I’m currently using ubercart 2 and need to print the locations of the products in the customer invoice. I’m using the location module to collect the location info and am already printing it in my node-product.tpl.php as:

Street:

print $location['street'];

But this won’t work for the customer invoices, as it doesn’t collect the node id. Can anyone offer nay help please?

Hope you’re well and taking care of yourself,

Evelyn

Comments

tr’s picture

You can print out the $product variable in the customer invoice (using print_r($product, TRUE) right after the place it prints $product->title for example) to see exactly how the Location module stores the data, but it's probably something like: $product->location['street'].

nyleve101’s picture

Hi TR,

Thanks for your response. I've tried adding:

print
'$product: <pre>'. print_r($product, TRUE) .'</pre>'

to the invoice template but it doesn't print any variables. I've also tried:

print '<pre>';
print_r(get_defined_vars());
print '</pre>';

But the only product variable i get are:

[products] => Array
(
[0] => stdClass Object
(
[order_product_id] => 52
[order_id] => 41
[nid] => 61
[title] => Jack the Ripper Walk
[manufacturer] =>
[model] => 61-17Apri
[qty] => 1
[cost] => 0.00000
[price] => 7.00000
[weight] => 0
[data] => Array
(
[attributes] => Array
(
[Dates] => Array
(
[0] => 17th April
(Saturday), 2010
)

)

[shippable] => 0
[module] => uc_product
)

[order_uid] => 1

And the only location information are the delivery and billing locations.

Any idea?

Thanks for your help so far!

Evelyn

longwave’s picture

Status: Active » Fixed

Old issue, but anyway:

$node = node_load($product->nid);
print $node->location['street'];

Status: Fixed » Closed (fixed)

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