get list of product line item in rule php how can I get product id of line items in checkout process with rule,
I know $commerce_order are there in rule, but how can I get list of product id ?
This is a good way to get them

$line_items = $commerce_order-&gt;commerce_line_items['und'];
 foreach($line_items as $lid) {
 $line_item = commerce_line_item_load($lid['line_item_id']);
$pid[] = $line_item-&gt;data['context']['product_ids'][0];
//also you  can load products
//  $product =  commerce_product_load($pid);
 }