Shopify-在产品页面上添加可选择的相关产品
我正在创建一个新的自定义部分,我想在其中添加不同的块。但是我找不到任何现有 /可用 /本机块类型的列表(block.type)。
编辑:我正在寻找可用的“专业输入设置”,而不是“块类型”。 在此相关文档!
我的最终目标是将元字段添加到产品实体中,允许管理员从现有产品中选择一系列产品,然后将此元产品字段绑定到我的新自定义部分中的“产品”块类型。
编辑:在回复中添加了一个解决方案。
I am creating a new custom section and I would like to add different kind of blocks in it. But I can't find any list of the existing / available / native blocks types (block.type).
EDIT : I was looking for available "specialized input settings" and not "block types". Here the related documentation !
My final goal would be to add meta field to the product entity, allowing an admin to pick a selection of products from an existing product, then to bind this meta product field, to a 'products' block type in my new custom section.
EDIT : Added a solution in reply.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,因此,感谢来自Discord的@Onkar和Patrick,这里相关文档: https://shopify.dev/themes/architecture/settings/settings/input-settings#specialized-input-settings
为了做我上述所描述的事情,我创建了一个专用的新元字段“相关信息”,产品实体:后端>设置> Metafields>自定义字段>产品(类型产品:产品列表)。
然后,我在主题文件中创建了一个新部分(部分/产品相关。liquid):
之后,我可以通过主题自定义将该部分添加到产品模板中。最后要做的是将我的自定义元字段映射到“ product_list”块 /输入。瞧!
Alright, so thanks to @Onkar and Patrick from discord, here the related documentation : https://shopify.dev/themes/architecture/settings/input-settings#specialized-input-settings
In order to do what I described above, I created a dedicated new meta field "related_product" for product entities : Backend > Settings > Metafields > Custom fields > Products (type Product : List of products).
Then I created a new section in my theme files (sections/product-related.liquid) :
After that I was able to add the section to my product template from Theme customisation. Last thing to do was to map / bind my custom meta field to the 'product_list' block / input. And voila !