使用 SOAP 在 Magento 中检索制造商元素

问题描述 投票:0回答:1

在这上面花了太多时间,我头疼...我需要在 Magento 中获取制造商(自定义?)属性值。

该网站的 XML 转储只向我显示了具有这两个制造商值的一个元素: ...

    <row>
            <field name="value_id">7</field>
            <field name="option_id">7</field>
            <field name="store_id">0</field>
            <field name="value">Hungry Gerbil</field>
    </row>
    <row>
            <field name="value_id">8</field>
            <field name="option_id">6</field>
            <field name="store_id">0</field>
            <field name="value">Hungry Hamster</field>
    </row>
    ...

我可以通过 SOAP 调用获取 option_id (7):

7

我想转换成:

饥饿的沙鼠

问题是,实际上我无法访问 xml 转储,因此我需要使用 SOAP 调用检索 eav_attribute_option_value 数据。 我已经使用此调用浏览了 [magento_root] 中的所有 138 个操作名称:

    $apicalls = array();
    $i = 0; 

    // Optional filters
    $filters = array('sku' => array('neq'=>''));

    // Initial call to get a list of product IDs
    $products = $client->call($session, 'catalog_product.list',array($filters));

    // Loop through product IDs and grab attributes & images
    foreach ($products as $product){
        $apicalls[$i] = array('catalog_product_attribute.info', $product['product_id']);
        $i++;
     }

所以我假设上面示例中“catalog_product_attribute.info”的正确替换将产生一个包含 eav_attribute_option_value 数据的数组。或者我找错地方了...

如果 Magento 有更好的文档,这将对我们所有人都有帮助,同时欢迎任何建议。

蒂姆

magento custom-attributes magento-soap-api
1个回答
0
投票

您获得了属性值 id。现在您应该使用 catalog_product_attribute.options.

获取标签
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.