How to Add "Add to cart" Button in product categories display
Here's the code I that built the add to cart button using a specific product_id:

&lt;?php 

$form_id = commerce_cart_add_to_cart_form_id(array($product-&gt;product_id));
$line_item = commerce_product_line_item_new($product);
$line_item-&gt;data['context']['product_ids'] = array($product-&gt;product_id);

$form = drupal_get_form($form_id, $line_item);
// render your $form somewhere

?&gt;