I am a beginner of drupal commerce, I know Drupal Commerce display product with node--product--type.tpl.php, "render($content)" does this work.

I need to add a property "monthly sales" to each node(product display) so that I can display it in node page.

With drupal core, I can use hook_load and hook_view to display custom properties, but it seems Drupal Commerce doesn't work by this way.

Where is place the array $content be generated and manipulated in Drupal Commerce? Which hook can I use?

Appreciate for any help or comments.


I got it, It's hook_entity_view. We can read profiles\commerce_kickstart\modules\contrib\commerce\modules\product_reference\commerce_product_reference.module for reference.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.