How can I retrieve the product ID? I am trying to retrieve the product IDs. I can find a product SKU by looking on the product page and using commerce_product_load_by_sku() to load it. 

How can I find the actual ID? I would like to use it in commerce_cart_product_add_by_id().
According to the docs I found here commerce_product_load_by_sku($sku) will return a $product object and one of the properties is product_id.

$product = commerce_product_load_by_sku($sku);
drupal_set_message($product-&gt;product_id);


The product object looks something like this:

[product_id] =&gt; 5
[sku] =&gt; EX151
[type] =&gt; class
[language] =&gt; und
[title] =&gt; Example Product
[uid] =&gt; 1
[status] =&gt; 1
[created] =&gt; 1316634672
[changed] =&gt; 1316639451
[data] =&gt; 
[commerce_price] =&gt; Array
    (
        [und] =&gt; Array
            (
                [0] =&gt; Array
                    (
                        [amount] =&gt; 12500
                        [currency_code] =&gt; USD
                        [data] =&gt; Array
                            (
                                [components] =&gt; Array
                                    (
                                    )

                            )

                    )

            )

    )