Load Magento configurable product based on attribute options
Is there a magento function that exists which will allow me to load a configurable products child product based on the attributes options used.
For example I have the option values for t-shirt color and size开发者_如何学Python, say 10, 45 (option id's) and I want to quickly get the id of the child simple product
For a configurable product $product
, use this function:
$product->getTypeInstance(true)->getProductByAttributes($attributesInfo, $product);
where $attributeInfo
is an array of $attributeId => $attributeValue
definitions.
精彩评论