0

I'm looking for get the simple products associated to a configurable one. I'm currently using this : $product->getTypeInstance->getUsedProducts($product); Where $product is a configurable.

But it return me simple products that have quantity > 0. Is there a method to also get the 'out of stock' products from a configurable ?

Thanks!

1

Following class is configurable product type class:

vendor/magento/module-configurable-product/Model/Product/Type/Configurable.php

Check the following method for child product collection:


public function getUsedProductCollection($product)
|improve this answer|||||
0

What I have done :

$product->getTypeInstance()->getUsedProductCollection($product)->getData()

Thank you Sohel Rana !

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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