How can I access and match selected flavor options to create a custom product and add it to the cart in WordPress? [closed]

I’m working on a WordPress site and I need to create a feature where customers can choose from different flavors for a custom product. Once the customer selects their desired options, they should be able to add the customized product to their car and order the product of their own choice

I added this code, and it works perfectly, but I am stuck after selecting different flavors how can I access the entire product information? I need to get the data where the user selected the flavour and made a customized product.

I tried using custom JS and CSS.