2012-02-19 5 views
0

서비스 모듈 및 REST 서버를 설치하여 제품 및 세부 정보 목록을 가져 왔습니다.서비스 모듈을 사용하여 Drupal Commerce에서 제품 가격을 얻는 방법은 무엇입니까?

의 제품 디스플레이 노드 및 제품 ID 만 얻을 수 있지만 Drupal Commerce의 제품 가격 및 재고 정보를 얻는 방법은 얻을 수 있습니다. (제품 표시 노드를 포함하여) 모든 노드의

목록

http://drupalcommerce.myappdemo.com/services/node

단일 제품 디스플레이 노드 http://drupalcommerce.myappdemo.com/services/node/37

받기 그러나이 제품 ID,하지만 제품 가격을 제공 않습니다.

하나 얻는 방법을 알려주세요.

+1

샌드 박스 모듈이있다 서비스와 Commerce를 통합하는 [Commerce Services] (http://drupal.org/sandbox/drupalista-br/1283494)라고 불리는 서비스입니다. 그 순간 당신이 직접 쓰지 않고 얻을 수있는 가장 가까운 것입니다. – Clive

답변

0

확인이 API는 Commerce Services 모듈을 설치하면

$order = commerce_cart_order_load($uid); 
    // Get the order for user just logged in. 
    $order_authenticated = reset(commerce_order_load_multiple(array(), array('uid' => $this->store_customer->uid, 'status' => 'cart'), TRUE)); 
    //update the order status 
    $form_state['order'] = commerce_order_status_update($order, 'checkout_checkout', TRUE); 
    // Load the order status object for the current order. 
    $order_status = commerce_order_status_load($order->status); 
    $profile = commerce_customer_profile_load($order->data['profiles'][$checkout_pane['pane_id']]); 
    $order = commerce_order_load($order->order_id); 
    // Give other modules a chance to alter the order statuses. 
    drupal_alter('commerce_order_status_info', $order_statuses); 
    $order_state = commerce_order_state_load($order_status['state']); 
     // Load the line items for temporary storage in the form array. 
    $line_items = commerce_line_item_load_multiple($line_item_ids); 
    // load line item 
    commerce_line_item_load($line_item_id) 
    //load the commerce product 
    $product = commerce_product_load($product_id) 
    // Load the referenced products. 
    $products = commerce_product_load_multiple($product_ids); 
0
  1. 도움이 될 것입니다.

  2. 는 사용 - '-> 검색 제품'당신의 서비스 엔드 포인트를위한 자원 및 '제품 표시> 검색'.

  3. ? Q에 GET를 수행은 = my_service_endpoint/제품 디스플레이/123.json이이 또한 참조하는 제품 (들)의 ID를 포함 노드 123의 제품 표시 정보를 얻을 것이다 이 노드 (예 : 제품 456)에 의해 제품 가격과 함께. 옵션

  4. 는 = my_service_endpoint/제품/456.json는,이 ID로 제품에 대한보다 완벽한 제품 정보를 얻을 것이다 ? Q에 GET을 456

관련 문제