Addind many products with same id

Hello. I need to add many same products Id to store

var productId = "com.myprod.prId";
var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
builder.AddProduct(productId, ProductType.Consumable, new IDs(){
{ productNameGoogleId,      GoogleStore.Name },
{ productNameAppleId,       AppleAppStore.Name }
});
UnityPurchasing.Initialize(this, builder);

In class ProductCollection

        internal void AddProducts(IEnumerable<Product> products)

        {
            m_ProductSet.UnionWith(products);
            m_Products = m_ProductSet.ToArray();
            m_IdToProduct = m_Products.ToDictionary(x => x.definition.id);
            m_StoreSpecificIdToProduct = m_Products.ToDictionary(x => x.definition.storeSpecificId);
        }

Result - exception.
We can have only one product Id with same product name. My target- create many product id and use same productNames.Many-to-many
For example: We have building.I want to upgrate it many times.
1)productId :ā€œBuildingMainHallUpgradeā€
productName:ā€œcom.prod.price300bucksā€

2)productId :ā€œBuildingTavernUpgradeā€
productName:ā€œcom.prod.price300bucksā€
How may I do this?

Sorry, but I don’t believe that you can at the current time.

1 Like