0
Array ( [und] => Array ( [0] => Array ( [tid] => 37 [taxonomy_term] => stdClass Object ( [tid] => 37 [vid] => 9 [name] => $10 - $20 **[description] => $10 - $20** [format] => filtered_html [weight] => 1 [vocabulary_machine_name] => prices ) ) ) ) 

Been trying things like this:

print $node->field_price['und']['0']['tid']->taxonomy_term; 

It's like a nested array with an object in there too..I'm not really sure how to get the [description] property that seems to be within the object in there.

Any help? Please!

2 Answers 2

1

Try:

echo $node->field_price['und'][0]['taxonomy_term']->description; 
Sign up to request clarification or add additional context in comments.

3 Comments

Fatal error: Cannot use object of type stdClass as array in C:\xampp\htdocs\drupal\sites\all\themes\simple7\node.tpl.php on line 24
Are you sure what you provided in the question was the output of var_dump($node);?
print_r($node->field_price);
0

Try this:

print $node->field_price[LANGUAGE_NONE]['0']['taxonomy_term']->description; 

LANGUAGE_NONE is the constant which has the 'key' name for the undefined languages and used across Drupal.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.