NF

{%- assign nutrients_ordered = "calories,total-fat,saturated-fat,trans-fat,cholesterol,sodium,total-carbohydrates,fiber,total-sugars,added-sugars,protein,vitamin-d,calcium,iron,potassium" | split: "," -%} {%- assign serving_data = "servings-per-container,serving-size-measure,serving-size-g" | split: "," -%} {% assign prod_meta = product.metafields.nutrition %} {%- if prod_meta[serving_data[0]]-%} {%- endif -%} {%- if prod_meta[serving_data[1]] or prod_meta[serving_data[2]] -%} {%- endif -%} {% for nutrient in nutrients_ordered %} {%- if prod_meta[nutrient] -%} {%- assign value = prod_meta[nutrient] -%} {%- assign nutrient_meta = shop.metafields.nutrition[nutrient] -%} {%- assign nutrient_words = nutrient | split: '-' -%} {%- capture nutrient_title -%} {%- for word in nutrient_words -%} {{ word | capitalize }} {%- endfor -%} {%- endcapture -%} {%- if forloop.first -%} {%- endif -%} {%- endif -%} {% endfor %}
Nutrition Facts
{{ prod_meta[serving_data[0]] }} servings per container
Serving size {{ prod_meta[serving_data[1]] }} {%- if prod_meta[serving_data[2]] -%} ({{ prod_meta[serving_data[2]] }}) {%- endif -%}
Amount per serving
{{ nutrient_title }} {{ value }}{{ nutrient_meta.units}} {%- if nutrient_meta.rdv -%} {{ value | times: 100.0 | divided_by: nutrient_meta.rdv | round }}% {%- else -%} No RDV {%- endif -%}
% Daily Value