Get all virtual goods in a category and their prices with Soomla

411 views Asked by At

I bet this is simple, but I can't seem to find a way to get all virtual goods in a specific category. Also, how to get a virtual good price?

1

There are 1 answers

2
cahen On BEST ANSWER

Getting the price:

PurchasableVirtualItem purchaseableVirtualItem = StoreInfo
    .GetPurchasableItemWithProductId (MyGameStore.NO_ADS_UNLOCK_ALL_PRODUCT_ID);

float unlockAllPrice = ((PurchaseWithMarket)purchaseableVirtualItem.PurchaseType)
    .MarketItem
    .MarketPriceAndCurrency;

You declare the category yourself, so you already have access to all IDs in it, see this example:

public static VirtualCategory GENERAL_CATEGORY = new VirtualCategory (
        "General", new List<string> (new string[] {
        NO_ADS_LIFETIME_PRODUCT_ID,
        NO_ADS_UNLOCK_ALL_PRODUCT_ID,
    }));