You can get the value from the product reference field. Example:
<?php // let's suppose that $product_display_node contains the node we are handling $product_id = $product_display_node->field_product[$product_display_node->language][0]['product_id'];
Comments
subscribe
subscribe
How to get Product-ID
I do it like this:
$pid = menu_get_object();
$pid -> field_product['und'][0]['product_id'];
You can get the value from
You can get the value from the product reference field. Example:
<?php
// let's suppose that $product_display_node contains the node we are handling
$product_id = $product_display_node->field_product[$product_display_node->language][0]['product_id'];
$product = entity_load('commerce_product', $product_id);
// use dpm() to show the entire object in the drupal's message system. requires Devel module
dpm($product);
?>