You can use: $available_variations = $product->get_available_variations();
If this is a single style template, make sure you add global $product;
near the top.
From there, you can foreach through the variations and do as you wish... since you didn't have any specific output I hope that this sets you on the right track.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…