html - Shopify - 自定义购物车属性未显示在订单 API 的 note_attributes 中
问题描述
我正在尝试为授权离开添加一个新复选框。按照 shopify 网站中的步骤操作:https ://help.shopify.com/en/themes/customization/cart/get-more-information-with-cart-attributes
该复选框显示在页面中,但在调用订单 API 检索交易时,note_attributes 字段始终为空。
我联系了 shopify 支持,他们说代码看起来不错,但他们无法解释为什么它没有出现在 note_attributes 中。
已经使用 shopify UI 生成器并尝试检查 shopify 论坛无济于事。
我已经更新了 cart-template.liquid 并在<form> .. </form>
标签下面添加了
<p class="cart-attribute__field">
<input type="hidden" name="attributes[Authority To Leave]" value="No">
<input type="checkbox" name="attributes[Authority To Leave]" value="Yes" checked>
<label>Authority To Leave</label>
</p>
我似乎无法弄清楚为什么它没有出现在 note_attributes 字段中。感谢有人能对此有所了解。
解决方案
推荐阅读
- mql4 - OrderClose 是在 OrderOpened 上方关闭订单 OP_SELL 并在下方关闭订单 OP_BUY?
- c# - WPF 上下文菜单命令未正确设置 IsEnabled
- c++ - 为什么同一主机上只有一个 UDP 客户端可以接收消息?
- java - 检索意图额外内容
- java - 运行代码时出现状态码 405 错误
- apache-spark-sql - CREATE TABLE tblname AS SELECT... 与 CREATE TABLE tblname(....) USING 有什么区别
地点 '...' - flutter - 尝试在 Flutter 中执行 HTTP Post 请求时出错
- python - YAML 加载程序将路径视为十六进制数
- angular - 调用服务文件中的函数时从两个组件获取数据
- reactjs - 为什么我的嵌套复数 ICU 消息在 react-intl FormattedMessage 中不起作用?