Create product programmatically I have a product with a custom field, according to this. I know I can create product with 

$cp = commerce_product_new('product');
$cp-&gt;is_new = TRUE;
$cp-&gt;revision_id = NULL;
$cp-&gt;uid = 1;
$cp-&gt;status = 1;
$cp-&gt;created = $cp-&gt;changed = time();
$cp-&gt;sku = $product[sku];
$cp-&gt;title = $product[name];
$cp-&gt;language = LANGUAGE_NONE;
$cp-&gt;commerce_price = array(LANGUAGE_NONE =&gt; array( 0 =&gt; array(
 'amount' =&gt; $product[sale_price] ? $product[sale_price] : $product[retail_price],
 'currency_code' =&gt; 'USD',
)));$product[retail_price];
commerce_product_save($cp);


but I have some custom field.

How can I create a Drupal Commerce product programmatically with full custom fields?

Is  $cp-&gt;myfield1='22'; sufficient?
A commerce product is an entity like any other, so...

$cp-&gt;field_my_field[LANGUAGE_NONE][0]['value'] = '22';