metafield label

I want to focus on the problem of metafields, first of all we should develop blocks that allow us to easily trace back to metafields, not through code that is increasingly heavy and complicated.

Then I would like to pay attention to the fact that it is not possible to show the label of metafields which is useful information in stores where the products are many and all different.

for those who have this problem like me I leave a code below that practically hides the metafield if it has no content.

<div id="product-metafield">

{% if product.metafields.custom.codice_prodotto %}

<span class="titolo">Codice prodotto:</span> <br>

<span>{{ product.metafields.custom.codice_prodotto }}</span>

{% endif %}

</div>

Please authenticate to join the conversation.

Upvoters
Status

In Review

Board

πŸ’‘ Feature Request

Date

28 days ago

Author

Atelier Milazzo

Subscribe to post

Get notified by email when there are changes.