1 reply [Last post]
BigMike's picture
Offline
Joined: 10/20/2008
Juice: 1057
Was this information Helpful?

D-6.22, UC-2.6

Hello UC,

I have a block displayed at the bottom of my product pages where I need to pull product info from other product nodes, specifically add to cart forms, and I would like to use PHP for this (I have other complications that prevent me from using a View here).

Problem:
If I use,
$node = node_load('123');
To load product node '123', this does not load the node body in full: it is missing the product image, attributes, and cart links.

I have tried...
$node = node_load(array("nid" => '123'));
which made no difference.

I have tried...
$node = menu_get_object($type = 'node', $position = 1, $path = NULL);
which does load the full node body complete with themed images, attributes, and cart links, however it pulls the NID from the path, so I can't use this to pull data from a product node that I'd like to specify, such as '123'.

So can someone help me?

My question in a nut shell:
How can I load a node array from a specified nid, and access, for instance...
$node->content['add_to_cart']["#value"]
when I am trying to load product node variables through a block via PHP just as if I was accessing it through my node-product.tpl.php file?

Thanks!
Mike

longwave's picture
Offline
Joined: 09/20/2008
Juice: 487
Re: node_load missing important product variables. How can we re

I think this is related to this Ubercart bug: http://drupal.org/node/753964

Please post this information over at drupal.org and I will try to look at it when I next get time to work on Ubercart 2.x.

--
These forums are for general support questions about Ubercart.
Bug reports and feature requests should be posted at http://drupal.org/project/issues/ubercart
Latest API documentation can be found at http://api.ubercart.me/