0

I need to get attribute codes used to build to the configurable product. How to get them in PHP? Please help.

1 Answer 1

0
$product->getTypeInstance()->getConfigurableAttributes($product);

You might want to add some checks, in case the product you are supplying isn't configurable.

\Magento\ConfigurableProduct\Model\Product\Type\Configurable::getConfigurableAttributes is only available there.

1
  • How can I get attribute code from returned value from getConfigurableAttributes?
    – Greck
    Commented May 8, 2019 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.