"Add to Cart" button/from in template (form ID from Node ID)? I'm working on a website made with D7 and the Commerce Module, with a "Products" view (for the Product content type) having this relationship field:

(Products referenced by field_info_prodotto) Commerce Product: Add to Cart form 

I want this "Buy Now" button/form to also be inside each products' page (= in the template for the Product content type).

I can create a template for single nodes (see code), but how should I edit the general template (node--product-display.tpl.php)?

# node--181.tpl.php    
&lt;form class="commerce-add-to-cart commerce-cart-add-to-cart-form-24" autocomplete="off"
action="/en/products" method="post" id="commerce-cart-add-to-cart-form-24" accept-charset="UTF-8"&gt;
&lt;div&gt;&lt;input type="hidden" name="product_id" value="24"&gt;
&lt;input type="hidden" name="form_id" value="commerce_cart_add_to_cart_form_24"&gt;
&lt;input name='form_token' type='hidden' value='&lt;?php print drupal_get_token('commerce_cart_add_to_cart_form_24'); ?&gt;'&gt;
&lt;div id="edit-line-item-fields--9" class="form-wrapper"&gt;&lt;/div&gt;&lt;input type="hidden" name="quantity"
value="1"&gt;
&lt;input type="submit" id="edit-submit--9" name="op" value="Add to cart" class="form-submit"&gt;
&lt;/div&gt;
&lt;/form&gt;


(In the template there is already the code to show a "Buy Now" field - field_tab_5 - but that's just an empty text field and I suppose it's not what I'm after).
Found a solution!


Add a field of type "Product reference" to the Product content type ("Inline entity form - Multiple values" as widget)
Use "Add to Cart Form" to its display format
Field API in node--product-display.tpl.php:

print render($content['field_info_prodotto']);