I have a product object of a simple product which belongs to a configurable. I'm trying to get the attributes of the configurable which led to the simple I have. Since each simple of a configurable is the result of selecting options of that configurable, that should be possible.
I have the full simple product option and of the attribute but only if I know the name of the attribute. Since the attribute is dynamic and can change I won't hardcode it.
There's a for Magento 1 but that won't work for Magento 2.
How do I get the configurable options that led to the simple I have available?
@landstaronline wrote:I have a product object of a simple product which belongs to a configurable. I'm trying to get the attributes of the configurable which led to the simple I have. Since each simple of a configurable is the result of selecting options of that configurable, that should be possible.
I have the full simple product option and of the attribute but only if I know the name of the attribute. Since the attribute is dynamic and can change I won't hardcode it.
There's a for Magento 1 but that won't work for Magento 2.
How do I get the configurable options that led to the simple I have available?
I ended up resolving the parent product and mapping the configurable attributes from the parent to the ones the simple product.
This works but I feel like it adds too much unnecessary overhead because now I need to load the full product every time I want to get the configurable options.