Discussions

Print prodict title / sku on node.tpl.php

hi,

this is how to render a product-field in the node.tpl.php:

<?php
 
print render($content['product:commerce_price']);
?>

but how can i render the title or sku?

Posted: Oct 4, 2011

Comments

oz_an on October 4, 2011

I think the field_product is the field name for the SKU. We can determine from the display manager of our content type how to render the product field, e.g as a add to cart button or as sku. If we choose the sku option from the product-display content type's display manager and print render($content[field_product]) then it renders as sku. But how can we do both? render as a button and as sku in tpl.php