I am looking to get WooCommerce product ID after successful addition of product in cart and store in global variable maybe? Because I want to use it on another page. I tried many way to get the ID but nothing work. Any idea?
I see someone marked this question duplicate, the solution in the link works for only first product added in cart, for example if someone add product A in cart, then on another page it shows the correct data, but if someone add product B, it still shows product A data. It doesn't change.