Search code examples
unity-game-enginesoomla

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


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?


Solution

  • 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,
        }));