/variant-machine.liquid Secret
Created
July 24, 2019 20:46
-
-
Save carbone/33e2219d21a190ce460ebf3eb2d2bc23 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% assign machine = shop.metafields.custom_fields["variant_fields"] | split: "|" %} | |
<div class="variant-custom-fields-wrapper"> | |
{%- for variant in product.variants -%} | |
<div class="variant-custom-fields" data-variant-id="{{ variant.id }}"> | |
<br /> | |
<div class="variant__title"><h3> {{ variant.title }}<strong> Model</strong></h3></div> | |
<div class="variant__cf"> | |
{% if machine != blank %} | |
{% for info in machine %} | |
{% assign machine_item = info | split: '='%} | |
{% assign human_name = machine_item[0] %} | |
{% assign machine_name = machine_item[1] %} | |
{% if variant.metafields.custom_fields[machine_name] !=blank %} | |
<div> | |
<strong>{{ human_name }}:</strong> | |
{{ variant.metafields.custom_fields[machine_name] }} | |
</div> | |
{% endif %} | |
{% endfor %} | |
{% endif %} | |
</div> | |
</div> | |
{%- endfor -%} | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment