Skip to content
Create a gist now

Instantly share code, notes, and snippets.

$thisNode = $element['#node'];
//Finding the Key the Product1 is in
$product1Key = 0;
foreach ($header as $key=>$item) {
if (preg_match('/.*Product1.*/',$item)) {
$product1Key = $key;
for ($i=$product1Key;$i<=$product1Key+4;$i++) {
$fieldProduct = 'field_product'.$j;
$theProduct = $thisNode->$fieldProduct;
$productId = $theProduct[0]['nid'];
$productName = $theProduct[0]['safe']['title'];
$header[$i] = '<a href="'.base_path().'node/'.$productId.'">'.$productName.'</a>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.