> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XStorePrice

> XStorePrice

# XStorePrice

商店價格資訊。

## 語法

```cpp theme={null}
typedef struct XStorePrice {  
    float basePrice;  
    float price;  
    float recurrencePrice;  
    const char* currencyCode;  
    char formattedBasePrice[PRICE_MAX_SIZE];  
    char formattedPrice[PRICE_MAX_SIZE];  
    char formattedRecurrencePrice[PRICE_MAX_SIZE];  
    bool isOnSale;  
    time_t saleEndDate;  
} XStorePrice  
```

### 成員

*basePrice*\
類型：float

產品的一般非促銷價格或建議零售價 (MSRP)。

*price*\
類型：float

使用者購買此項目時實際支付的價格。

*recurrencePrice*\
類型：float

週期性價格。

*currencyCode*\
類型：const char\*

價格的貨幣代碼。

*formattedBasePrice*\
類型：char\[PRICE\_MAX\_SIZE]

可在遊戲 UI 中顯示的格式化 basePrice。

*formattedPrice*\
類型：char\[PRICE\_MAX\_SIZE]

應在您的 UI 中用來宣傳產品的格式化價格。

*formattedRecurrencePrice*\
類型：char\[PRICE\_MAX\_SIZE]

格式化的週期性價格。

*isOnSale*\
類型：bool

指出產品是否正在特價。

*saleEndDate*\
類型：time\_t

特價的結束日期。

## 備註

*basePrice* 不一定是應該宣傳的價格。您一律應在 UI 中宣傳 price 變數中的值，而不是 basePrice 變數中的值。您可以使用 basePrice 變數來判斷特價期間提供多少折扣。接著，您可以在 UI 中的 price 變數旁邊，以刪除線文字顯示 basePrice，協助使用者了解價值和節省的金額。

**XStorePrice** 是 [XStoreAvailability](/zh-TW/reference/system/xstore/structs/xstoreavailability) 結構的成員。**XStorePrice** 是 [XStoreProduct](/zh-TW/reference/system/xstore/structs/xstoreproduct) 結構的成員。**XStorePrice** 是 [XStoreSku](/zh-TW/reference/system/xstore/structs/xstoresku) 結構的成員。

## 需求

**標頭：** XStore.h (包含在 XGameRuntime.h 中)

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[XStore](/zh-TW/reference/system/xstore/xstore_members)\
[XStoreAvailability](/zh-TW/reference/system/xstore/structs/xstoreavailability)\
[XStoreProduct](/zh-TW/reference/system/xstore/structs/xstoreproduct)\
[XStoreSku](/zh-TW/reference/system/xstore/structs/xstoresku)


## Related topics

- [XStorePrice](/reference/system/xstore/structs/xstoreprice.md)
- [XStoreAvailability](/reference/system/xstore/structs/xstoreavailability.md)
