Skip to product information
【Dawn】Shopifyのテーマ「Rise/Dawn」の商品ページでメタフィールドに連動するブロックを追加した際に対象商品のメタフィールドに値が無ければ非表示にする設定例
Published:2024.10.09

[Dawn] An example of a setting that hides a metafield if the metafield of the target product has no value when adding a block linked to the metafield on the product page of the Shopify theme "Rise/Dawn"

On the product page of the Shopify theme "Dawn/Rise," you can link the contents of product metafields to block elements, etc., but sometimes metafields are not available for all products. In such cases, this is an example of how to hide them.


An example of a setting that hides a metafield if the metafield of the target product has no value when adding a block linked to the metafield on the product page of the Shopify theme "Rise/Dawn"


[(For the Rise theme) Setting procedure ①] Add the schema to "sections/main-product.liquid" and the label to "ja.schema.json"


[(For the Rise theme) Setting procedure ②] Add the code to the {%- when 'collapsible_tab' -%} condition in "sections/main-product.liquid"


After making a purchase (all items are ¥0), you will be able to view the sample code.

View store information

[Dawn] An example of a setting that hides a metafield if the metafield of the target product has no value when adding a block linked to the metafield on the product page of the Shopify theme "Rise/Dawn"

If you have already made a purchase, please login here.

Sample Codes

Test Theme :Dawn/Rise 15.2.0

Add schema to "sections/main-product.liquid"

Add a label to "ja.schema.json"

Add the code to the {%- when 'collapsible_tab' -%} condition in "section...

↗ Related Post

すべてのShopify TIPS

View all