【问题标题】:Are line item properties exposed in the Shopify Order API?Shopify 订单 API 中是否公开了订单项属性?
【发布时间】:2012-08-24 11:28:22
【问题描述】:

是否可以在 Order API 中检索所有订单行项目的自定义属性(参见此处 http://wiki.shopify.com/Line_Item_Properties)?

我需要为所有订单创建自定义报告,但它们依赖于显示这些属性。

【问题讨论】:

    标签: api shopify


    【解决方案1】:

    默认情况下,订单项属性会通过存在的订单 API 公开。这是一个示例行项目 XML sn-p,请注意底部的“字母组合”属性:

    <line-items type="array">
      <line-item>
        <id type="integer">223039148</id>
        <requires-shipping type="boolean">true</requires-shipping>
        <fulfillment-service>manual</fulfillment-service>
        <grams type="integer">0</grams>
        <price type="decimal">9.99</price>
        <quantity type="integer">1</quantity>
        <sku/>
        <title>All the Tests</title>
        <product-id type="integer">90620559</product-id>
        <variant-id type="integer">212221205</variant-id>
        <vendor>soundcloud</vendor>
        <variant-title nil="true"/>
        <fulfillment-status nil="true"/>
        <name>All the Tests</name>
        <variant-inventory-management/>
        <properties type="array">
          <property>
            <name>Monogram</name>
            <value>omg</value>
          </property>
        </properties>
      </line-item>
    </line-items>
    

    请注意,如果属性数组为空,则该数组将不存在,因此请确保在代码中满足这一要求。

    【讨论】:

    • 优秀。感谢那。我本可以不那么懒惰并自己测试它,但这将涉及使用 Cart API 进行修改。非常感谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多