How Do I Grab All The Feature/variant Combos Available For A Product?

Hello, say I had a product id and that product has 2 or more features and several variants from those features.

How can I retrieve all the variants for that product, like how the product page does it? I don't necessarily need the product ids of the other variants, just the name of the features and the variants.

For example, I have a product that's a shirt with the features color and size (and variants for all those).

If I have the product id, how do I grab for example:

Color:

Green

Blue
Red

Size:

Small

Medium
Large

I've been looking in the product variations addon, but I can't seem to find anything, any help would be appreciated.

Use the fn_get_product_features() function.

To get the variations of a product you will have to use the ProductCollection class in the product_variations addon.