別のシステムのMagento-APIを介して構成可能な製品をエクスポート/インポートしたいと考えています。私たちにとって重要なのは、3色(赤、緑、青)のTシャツのような構成可能な製品の価値です。
次の関数で構成可能な属性を受け取ります。
public function options($productId, $store = null, $identifierType = null)
{
$product = $this->_getProduct($productId, $store, $identifierType);
if (!$product->getId()) {
$this->_fault('not_exists');
}
$configurableAttributeCollection = $product->getTypeInstance()->getConfigurableAttributes();
$result = array();
foreach($configurableAttributeCollection as $attribute){
$result[$attribute->getProductAttribute()->getAttributeCode()] = $attribute->getProductAttribute()->getFrontend()->getLabel();
//Attr-Code: $attribute->getProductAttribute()->getAttributeCode()
//Attr-Label: $attribute->getProductAttribute()->getFrontend()->getLabel()
//Attr-Id: $attribute->getProductAttribute()->getId()
}
return $result;
}
しかし、上記の関数で取得した構成可能属性から、現在使用可能なラベル/ IDを使用して、その製品で使用されているオプション(構成可能属性が「色」の場合は青、緑、赤)を取得するにはどうすればよいでしょうか。
答えは大歓迎です!
ティム