How can I dynamically select different product ids in an array?

Hello everybody,

I am trying to build a configurator and experimenting with arrays and product.ids
I want to add the product id to the array when I press the button “Try it”.
The problem right now is, that the same product id is selected everytime.
Do you have any idea on how to fix this ?

https://boxifique.com/pages/configurator-layers


    

Have a good one!