是否存在magento函数,它允许我根据使用的属性选项加载可配置产品子产品 .
例如,我有T恤颜色和尺码的选项值,比如10,45(选项ID),我想快速获得儿童简单产品的ID
对于可配置产品 $product ,请使用此功能:
$product
$product->getTypeInstance(true)->getProductByAttributes($attributesInfo, $product);
其中 $attributeInfo 是 $attributeId => $attributeValue 定义的数组 .
$attributeInfo
$attributeId => $attributeValue
1 回答
对于可配置产品
$product
,请使用此功能:其中
$attributeInfo
是$attributeId => $attributeValue
定义的数组 .