I want to list all the items with their name, description and price when the player opens the shop in my game. In addition, I don't want that you can exceed the maximum quantity of an item. For example, it shouldn't be possible that a user has more than 3 Bamboo Swords in his inventory. If a user has 3 Bamboo Swords, then he can not make another Bamboo Sword purchase. But it should be possible to purchase another Bamboo Sword after you consumed one in the game.
I have 3 items in my primary catalog. In addition, I created a store with the same 3 items, 2 of them are on sale in this store(Id = "EventSale").
I created a foreach loop, but I don't know how to get the name and description of the items. I just get the ItemId, VirtualCurrencyPrices and RealCurrencyPrices. Is it not possible to get the name and a description of the item when I use GetStoreItemsAsync?
private async Task GetVcStore() { var primaryCatalogName = "New Shop"; var storeId = "EventSale"; var result = await PlayFabClientAPI.GetStoreItemsAsync(new GetStoreItemsRequest() { CatalogVersion = primaryCatalogName, StoreId = storeId }); foreach (var entry in result.Result.Store) { Console.WriteLine($"{entry.ItemId} {entry.VirtualCurrencyPrices} {entry.RealCurrencyPrices}"); } if (result.Error != null) { Console.WriteLine(result.Error.GenerateErrorReport()); } else { Console.WriteLine("Listed items successful!"); } }
In my PlayFab account, you can see the 3 items. I want to get the display name and description of each item in my game. In this case, it would be "Bamboo Sword" and "Get the fantastic Bamboo Sword!".