> ## 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 中使用 basePrice 并在其上添加文本删除线以及 price 变量，帮助用户了解价值和节省金额。

**XStorePrice** 是 [XStoreAvailability](/reference/system/xstore/structs/xstoreavailability) 结构的成员。**XStorePrice** 是 [XStoreProduct](/reference/system/xstore/structs/xstoreproduct) 结构的成员。**XStorePrice** 是 [XStoreSku](/reference/system/xstore/structs/xstoresku) 结构的成员。

## 要求

**头文件：** XStore.h（包含在 XGameRuntime.h 中）

**支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

## 另请参阅

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


## Related topics

- [XStoreAvailability](/zh-CN/reference/system/xstore/structs/xstoreavailability.md)
- [XStore](/zh-CN/reference/system/xstore/xstore_members.md)
- [XStoreSku](/zh-CN/reference/system/xstore/structs/xstoresku.md)
- [XStoreProduct](/zh-CN/reference/system/xstore/structs/xstoreproduct.md)
- [Economy v2 中的真钱价格跟踪](/zh-CN/services/playfab/economy-monetization/economy-v2/tutorials/real-money-price-tracking.md)
