I am trying to make a module that works with ubercart. What I need to know is how do I hook into the loading of a product. I want to modify some of the data slightly before any output. Thanks
Asked
Active
Viewed 292 times
1 Answers
2
Use hook_nodeapi and the load view $op to add/alter data.
http://api.drupal.org/api/function/hook_nodeapi
This function is fired when a node is being loaded. What you will want to do is:
mymodule_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch ($op) {
case 'load':
if ($node->type == 'product') {
var_dump($node);
}
}
}
Try that out. That should dump the node object if the node is a product, and you can see how to add/alter data in the node object from there.

Kevin
- 13,153
- 11
- 60
- 87
-
Thanks that was a lot easier than I thought it was going to be. – Kareed Jun 13 '10 at 19:49