2013-10-08 3 views

답변

2

찾고 계신 order_id를 가져와야합니다. SQL 쿼리를 사용하여이 작업을 수행 할 수 있습니다.

당신이 ORDER_ID이 있으면, 당신은 commerce_order_load($order_id)

참조하여 순서를로드 할 수 있습니다 : 당신은 당신이 echo "<pre>"; print_r($order);로를 탐험 할 수있는 $ 순서 개체 (들)을 가지고 때 http://drupalcontrib.org/api/drupal/contributions!commerce!modules!order!commerce_order.module/function/commerce_order_load/7

나는 확실히 모든입니다 필요한 변수가 거기에있을 것입니다.

0

이것은 내가하는 일입니다.

$order_wrapper = entity_metadata_wrapper('commerce_order', $order); 
$quantityAndPrice = array(); 

foreach ($order_wrapper->commerce_line_items as $line_item_wrapper) 
{ 
    $quantityAndPrice .= round($line_item_wrapper->quantity->value()) .""; 
    $quantityAndPrice .= $line_item_wrapper->commerce_unit_price->amount->value(); 
}