Created
March 27, 2013 14:38
-
-
Save karelbemelmans/5254674 to your computer and use it in GitHub Desktop.
dpm a $node and its attached $product
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_node_view(). | |
*/ | |
function foo_node_view($node, $view_mode, $langcode) { | |
if ($node->type == 'product_display') { | |
$product_id = $node->field_product[LANGUAGE_NONE][0]['product_id']; | |
$product = commerce_product_load($product_id); | |
dpm ($node, 'node'); | |
dpm ($product, 'product'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment