Shopify功能查询输入

huangapple go评论55阅读模式
英文:

Shopify Functions Query Input

问题

我遇到了关于我的Shopify功能的问题,我想在客户选择自取时为产品提供折扣。是否有一种方法可以知道客户是否选择了"自取"作为送货选项?我尝试查看此选项这里,但无论我选择运输选项还是自取选项,Shopify的响应都为空。以下是我的输入查询:

query Input {
  cart {
    lines {
      quantity
      merchandise {
        __typename
        ...on ProductVariant {
          id
        }
      }
    }
    deliveryGroups {
      selectedDeliveryOption {
        deliveryMethodType
      }
    }
  }
  discountNode {
    metafield(namespace: "this", key: "that") {
      value
    }
  }
}

我是否做错了什么?有什么想法我可以尝试吗?

英文:

Im having trouble with my Shopify Function where I want to give a discount on the products if the client chooses pickup. Is there a way to get if the client picked PICK_UP as the delivery option ? I tried looking into this option HERE, but the response from shopify comes back empty does not matter if I choose shipping option or a pickup option. Here is my input query:

query Input {
  cart {
    lines {
      quantity
      merchandise {
        __typename
        ...on ProductVariant {
          id
        }
      }
    }
    deliveryGroups {
      selectedDeliveryOption {
        deliveryMethodType
      }
    }
  }
  discountNode {
    metafield(namespace: "this", key: "that") {
      value
    }
  }
}

Am I doing anything wrong? Any ideas what I could try?

答案1

得分: 1

对于那些正在研究这个问题的少数人。显然这是一个错误,Shopify的开发人员已经意识到了并正在努力修复它。直到今天为止,它还没有被修复。一旦Shopify修复了这个错误,我会在这里进行更新。

英文:

For those few of you who were looking into this. Apparently it IS a bug and the Shopify Devs are aware of it and are working to fix it. Until today it has not been fixed yet. Ill update here once the bug is fixed by shopify.

huangapple
  • 本文由 发表于 2023年2月8日 19:36:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/75385226.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定