【问题标题】:Magento 2 Rest Api V1/products missing extension attributesMagento 2 Rest Api V1/产品缺少扩展属性
【发布时间】:2017-06-14 09:55:06
【问题描述】:

我正在调用 Rest API V1/products 从 Magento 2 商店获取产品列表

请求:

 http://{myMagentohost}/Magento/index.php/rest/V1/products?searchCriteria[currentPage]=1&searchCriteria[pageSize]=1

回复:

 {"items": [ { "id": 1,"sku": "24-MB01","name": "Joust Duffle Bag","attribute_set_id": 15,"price": 34,"status": 1,"visibility": 4,"type_id": "simple","created_at": "2017-06-13 09:36:11","updated_at": "2017-06-13 09:36:11","product_links": [{"sku": "24-MB01", "link_type": "upsell","linked_product_sku": "24-MB03","linked_product_type": "simple","position": null,"extension_attributes": []},{"sku": "24-B01","link_type": "upsell","linked_product_sku": "24-WB04","linked_product_type": "simple","position": null,"extension_attributes": []}],"options": [],"tier_prices": [],"custom_attributes": [{"attribute_code": "description","value": "<p>The sporty Joust Duffle Bag can't be beat - ot in the gym, not on the luggage carousel, not anywhere. Big enough to haul a basketball or soccer ball and some sneakers with plenty of room to spare, it's ideal for athletes with places to go.<p>\n<ul>\n<li>Dual top handles.</li>\n<li>Adjustable shoulder strap.</li>\n<li>Full-length zipper.</li>\n<li>L 29\" x W 13\" x H 11\".</li>\n</ul>"},{"attribute_code": "image","value": "/m/b/mb01-blue-0.jpg"},{"attribute_code": "small_image","value": "/m/b/mb01-blue-0.jpg"},{"attribute_code": "thumbnail","value": "/m/b/mb01-blue-0.jpg"},{"attribute_code": "url_key","value": "joust-duffle-bag"}]}],"search_criteria": {"filter_groups": [],"page_size": 1,"current_page": 1},"total_count": 2046}

现在根据 Magento 2 Rest API swagger 文档, catalogProductRepositoryV1, GET /V1/products 作为响应它显示了 extension_attributes 但是当我实际从邮递员调用这个 api 时 extension_attributes 丢失了。

我正在搜索它,但没有合适的解决方案。

谁能帮忙解决这个问题?

谢谢!

【问题讨论】:

    标签: rest product catalog magento-2.0


    【解决方案1】:

    我们正在使用 M2Ent Cloud Edt,我们与 Magento 支持人员有一张未结票,他们确认这是 REST API 的问题。

    为了规避,我们最初通过 V1/products 使用分页循环遍历所有产品(否则会很快超时 60 秒),然后调用 V1/products/{sku} 以获取所有详细信息(其中正确包含 extension_attributes 节点。

    他们没有给我们一个修复的预计到达时间。

    【讨论】:

    • 我们还必须为每个产品发出单独的请求以获取自定义属性数据。烦人……
    猜你喜欢
    • 2017-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-22
    • 2013-10-25
    • 1970-01-01
    相关资源
    最近更新 更多