---
title: "EntityViewサンプル – 注文概要"
slug: "entityview-sample---order-summary"
abstract: "注文サマリーエンティティビューを扱うためのコードサンプルを提供します。"
---
# EntityViewサンプル – 注文概要

Ordersプラグインによって提供されたプロパティが追加されました:

OrderConfirmationId<=order.OrderConfirmationId
OrderPlacedDate<=order.OrderPlacedDate
DateUpdated<=order.DateUpdated
Status<=order.Status
PaymentStatus<=order.PaymentStatus
ShopName<=order.ShopName
CustomerEmail<=order.GetComponent<ContactComponent>().Email
OrderSubTotal<=order.Totals.SubTotal
OrderAdjustmentsTotal<=order.Totals.AdjustmentsTotal
OrderGrandTotal<=order.Totals.GrandTotal
OrderPaymentsTotal<=order.Totals.PaymentsTotal

例えば、ギフトカードの購入が注文の場合に提供されるギフトカードプラグイン:

GiftCardPurchased<=line.GetComponent<GiftCardComponent>().GiftCardCode
GiftCardAmount<=line.GetComponent<GiftCardComponent>().GiftCardAmount

AdventureWorksプラグインによって提供されています。これは注文がクーポンを使うカスタマイズのサンプルです:

CouponUsed<=line.GetComponent<CartCouponsComponent>().Name

EntityViewを取得するためのサンプル呼び出し:

http://{{ServiceHost}}/{{ShopsApi}}/GetEntityView()

本文:

{
 "entityId":"{006fa25e-d3ca-4e05-97fb-55afd8568e2e}",
 "viewName":"Summary",
 "forAction":""
}

電話会議のサンプル結果:

{
 "@odata.context": "http://localhost:5000/Api/$metadata#Sitecore.Commerce.EntityViews.EntityView",
 "@odata.type": "#Sitecore.Commerce.EntityViews.EntityView",
 "Name": "Summary",
 "Policies": ,
 "DisplayName": "Summary",
 "EntityId": "{006fa25e-d3ca-4e05-97fb-55afd8568e2e}",
 "Action": "",
 "ItemId": "",
 "Properties": 
 {
 "Name": "OrderConfirmationId",
 "Policies": ,
 "DisplayName": "Order Confirmation Id",
 "Value": "{006fa25e-d3ca-4e05-97fb-55afd8568e2e}",
 "IsHidden": false,
 "OriginalType": "String",
 "IsReadOnly": true,
 "UiType": ""
 },
 {
 "Name": "OrderPlacedDate",
 "Policies": ,
 "DisplayName": "Placed Date",
 "Value": "8/19/2016 \`9:52\`:02 PM",
 "IsHidden": false,
 "OriginalType": "DateTime",
 "IsReadOnly": true,
 "UiType": ""
 },
 {
 "Name": "DateUpdated",
 "Policies": ,
 "DisplayName": "Date Updated",
 "Value": "8/19/2016 \`9:52\`:09 PM",
 "IsHidden": false,
 "OriginalType": "DateTime",
 "IsReadOnly": true,
 "UiType": ""
 },
 {
 "Name": "Status",
 "Policies": ,
 "DisplayName": "Status",
 "Value": "Completed",
 "IsHidden": false,
 "OriginalType": "String",
 "IsReadOnly": true,
 "UiType": ""
 },
 {
 "Name": "PaymentStatus",
 "Policies": ,
 "DisplayName": "Payment Status",
 "Value": "Paid",
 "IsHidden": false,
 "OriginalType": "String",
 "IsReadOnly": true,
 "UiType": ""
 },
 {
 "Name": "ShopName",
 "Policies": ,
 "DisplayName": "Shop Name",
 "Value": "Storefront",
 "IsHidden": false,
 "OriginalType": "String",
 "IsReadOnly": true,
 "UiType": ""
 },
 {
 "Name": "CustomerEmail",
 "Policies": ,
 "DisplayName": "Customer Email",
 "Value": "email@domain.com",
 "IsHidden": false,
 "OriginalType": "String",
 "IsReadOnly": true,
 "UiType": ""
 },
 {
 "Name": "OrderSubTotal",
 "Policies": ,
 "DisplayName": "Order Sub Total",
 "Value": "USD940.00",
 "IsHidden": false,
 "OriginalType": "Money",
 "IsReadOnly": true,
 "UiType": ""
 },
 {
 "Name": "OrderAdjustmentsTotal",
 "Policies": ,
 "DisplayName": "Order Adjustments Total",
 "Value": "USD94.00",
 "IsHidden": false,
 "OriginalType": "Money",
 "IsReadOnly": true,
 "UiType": ""
 },
 {
 "Name": "OrderGrandTotal",
 "Policies": ,
 "DisplayName": "Order Grand Total",
 "Value": "USD1,034.00",
 "IsHidden": false,
 "OriginalType": "Money",
 "IsReadOnly": true,
 "UiType": ""
 },
 {
 "Name": "OrderPaymentsTotal",
 "Policies": ,
 "DisplayName": "Order Payments Total",
 "Value": "USD413.60",
 "IsHidden": false,
 "OriginalType": "Money",
 "IsReadOnly": true,
 "UiType": ""
 }
 ,
 "ChildViews": ,
 "DisplayRank": 500,
 "UiHint": "Flat"
}