将 Shopify 管理订单中包含 HTML 值的 line_item.properties 数据呈现为 HTML

发布于 2025-01-17 01:11:03 字数 494 浏览 3 评论 0原文

您好,我想知道是否可以在我的订单中将这些自定义 line_items.properties 值呈现为 HTML?在shopify中,到目前为止,查看订单时看起来是这样的。对象值不会呈现那些 HTML 标记。

输入图片此处描述

我使用下面的格式将订单提交到我的 Shopify 帐户,我有点希望它会显示一个查看图片链接。

properties: {
   sample_image: "<a href="https://static.remove.bg/sample-gallery/graphics/bird-thumbnail.jpg">View Image</a>"
}

Hi so I'm wondering If it is possible to render these custom line_items.properties value as HTML in my orders? in shopify, as of now it appears like this when the order is viewed. The object value is not rendering those HTML tags.

enter image description here

I'm using the format below to submit the order onto my Shopify account and I was kinda hoping it will display a View Image link.

properties: {
   sample_image: "<a href="https://static.remove.bg/sample-gallery/graphics/bird-thumbnail.jpg">View Image</a>"
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

往事随风而去 2025-01-24 01:11:03

我解决了这个问题,所以当时我不知道shopify已经可以处理这种数据了。如果 lineItem.properties 具有 URL 值或任何类型的链接,shopify 将自动向其添加锚标记。

因此,无需向 lineItem.properties 添加锚标记,只需使用普通的链接/url 即可完成工作。

I solved it, so what I didn't know by then is that shopify already handle this kind of data. If the lineItem.properties has a value of URL or any kind of link, shopify will automatically add an anchor tag to it.

So instead of adding an anchor tag to the lineItem.properties, just use the ordinary link/url and that'll do the job.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文