Liquid, JavaScript, themes, sales channels
To continue receiving payouts, you need to secure your account by turning on two-step authentication. If two-step authentication is not turned on your payouts will be paused. Learn more
Hello,
I am using the Dawn 2.0 theme. I have created page with a html table. I have also created a product metafield.
I would like to add this product metafield to one of the cells in this table. Is that possible?
<table width="100%">
<tbody>
<tr>
<td style="width: 35.0423%;">Test1</td>
<td style="width: 26.9577%;">Test2</td>
<td style="width: 31%;">Test3</td>
</tr>
<tr>
<td style="width: 35.0423%;">Case A</td>
<td style="width: 26.9577%;">8</td>
<td style="width: 31%;">2</td>
</tr>
<tr>
<td style="width: 35.0423%;">Case B</td>
<td style="width: 26.9577%;">3</td>
<td style="width: 31%;">2</td>
</tr>
<tr>
<td style="width: 35.0423%;">Case C</td>
<td style="width: 26.9577%;">5</td>
<td style="width: 31%;">4</td>
</tr>
</tbody>
</table>
Hi @fro,
You can get Metafields directly and add to table. For example for Metafields is subtitle
You just need to add the following code where you want to display the Metafields, it will work fine:
{{ product.metafields.my_fields.subtitle }}
Hope it helps!
Unfortunately, this does not seem to work.
I added a text metafield en copied the key/name to the html table in a new page.
Then I added the page as a dynamic source to the collapsible row on the product page.
Hi @fro,
With page content displayed at 'Collapsible content', it would be impossible.
Because page content doesn't support liquid code so if you want to add Metafield you need to create your own field and add code for it, instead of getting a content page.
Hope it is clear to you.
I was looking for a very similar thing to generate tables and ended up developing this free tool which can be implemented easily into your theme. https://webforward.github.io/shopify-tables/
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022