> ## Documentation Index
> Fetch the complete documentation index at: https://foliant-help.iforiti.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Artikelpositionen in Vorlagen

> Durchlaufen Sie die Artikelpositionen einer Bestellung in Liquid und drucken Sie Titel, Mengen, Preise, SKUs, Bilder, Gewichte und Eigenschaften.

Die Artikel einer Bestellung stehen in `line_items`. Um sie zu drucken, durchlaufen Sie die Liste in einer Schleife: Alles zwischen `{% for line_item in line_items %}` und `{% endfor %}` wird einmal pro Artikel wiederholt, und `line_item` ist der jeweils aktuelle Artikel. Felder von Artikelpositionen funktionieren nur innerhalb der Schleife.

## Eine einfache Artikeltabelle

```liquid theme={null}
<table>
  {% for line_item in line_items %}
    <tr>
      <td>{{ line_item.title }}</td>
      <td>{{ line_item.sku }}</td>
      <td>{{ line_item.quantity }}</td>
      <td>{{ line_item.price | money }}</td>
      <td>{{ line_item.line_price | money }}</td>
    </tr>
  {% endfor %}
</table>
```

## Felder von Artikelpositionen

| Variable | Was sie ausgibt |
| - | - |
| `line_item.title` | Den Titel des Artikels (Produkt und Variante) |
| `line_item.name` | Den Namen des Artikels |
| `line_item.product_title` | Den Titel des Produkts |
| `line_item.variant_title` | Den Titel der Variante, etwa „Blau / Groß“ |
| `line_item.quantity` | Die bestellte Menge, einschließlich erstatteter Artikel |
| `line_item.fulfillable_quantity` | Wie viele noch auszuführen sind |
| `line_item.refunded_quantity` | Wie viele erstattet wurden |
| `line_item.sku` | Die SKU |
| `line_item.vendor` | Den Anbieter |
| `line_item.price` | Den Stückpreis nach Positionsrabatten (in Cent) |
| `line_item.original_price` | Den Stückpreis vor Rabatten (in Cent) |
| `line_item.line_price` | Die Positionssumme: Stückpreis × Menge, nach Positionsrabatten (in Cent) |
| `line_item.total_discount` | Den Rabatt der Position (in Cent) |
| `line_item.discount_per_item` | Den Rabatt pro Artikel (in Cent) |
| `line_item.total_tax` | Die Steuer der Position (in Cent) |
| `line_item.cost` | Die Kosten des Artikels, für Bestellungen beim Lieferanten (in Cent) |
| `line_item.tax_lines` | Die Steuern der Position: in einer Schleife für `title`, `rate`, `price` |
| `line_item.discount_allocations` | Die auf die Position angewendeten Rabatte: in einer Schleife für `amount` |
| `line_item.properties` | Eigenschaften der Artikelposition. Siehe [Bestellattribute und Eigenschaften von Artikelpositionen](https://foliant-help.iforiti.com/de/template-editor/liquid-custom-fields.md). |
| `line_item.hs_tariff_code` | Den HS-Zolltarifcode |
| `line_item.country_of_origin` | Das Herkunftsland |
| `line_item.weight` | Das Gewicht eines Artikels, in seiner eigenen Einheit |
| `line_item.grams` | Das Gewicht eines Artikels in Gramm; `{{ line_item.grams \| weight_with_unit }}` fügt die Einheit hinzu |
| `line_item.total_weight` | Das Gewicht der Position (Artikel × Menge) |
| `line_item.image` | Das Bild des Artikels; `{{ line_item.image \| img_url: 'thumb' \| img_tag }}` druckt es |
| `line_item.requires_shipping` | Ob der Artikel versendet werden muss |
| `line_item.gift_card` | Ob der Artikel eine Geschenkkarte ist |
| `line_item.product` | Das Produkt (`title`, `type`, `vendor`, `tags`, `handle`…) |
| `line_item.variant` | Die Variante (`title`, `sku`, `barcode`, `option1`, `inventory_quantity`…) |

## Häufige Muster

Den Variantentitel unter dem Produkt drucken, nur wenn es einen gibt:

```liquid theme={null}
{{ line_item.product_title }}
{% if line_item.variant_title != blank %}<br>{{ line_item.variant_title }}{% endif %}
```

Vollständig erstattete Artikel auf einem Lieferschein weglassen:

```liquid theme={null}
{% for line_item in line_items %}
  {% if line_item.quantity > line_item.refunded_quantity %}
    {{ line_item.title }} × {{ line_item.quantity | minus: line_item.refunded_quantity }}
  {% endif %}
{% endfor %}
```

Einen Barcode für jede SKU anzeigen:

```liquid theme={null}
{{ line_item.sku | barcode }}
```

## Ein Dokument pro Sendung

Wenn eine Vorlage ein Dokument pro Sendung druckt (**Teilsendungen** auf der Einstellungsseite der Vorlage), ist `document_fulfillment` die gerade gedruckte Sendung. So listen Sie nur auf, was darin enthalten ist:

```liquid theme={null}
{% if document_fulfillment %}
  {% assign line_items = document_fulfillment.line_items %}
{% endif %}
```

## Gut zu wissen

* Preise sind in Cent angegeben: Drucken Sie sie immer mit einem Geldfilter. Siehe [Geld und Währung in Vorlagen](https://foliant-help.iforiti.com/de/template-editor/liquid-money-and-currency.md).
* Artikelbilder werden in der Größe gedruckt, die Sie mit `img_url` angeben, etwa `'thumb'`, `'small'`, `'medium'` oder `'120x120'`.
* Metafelder von Produkten und Varianten finden Sie unter `line_item.product.metafields` und `line_item.variant.metafields`. Siehe [Metafelder in Vorlagen](https://foliant-help.iforiti.com/de/template-editor/metafields.md).
* Den Namen der Schleifenvariable können Sie frei wählen, aber `line_item` entspricht der Referenz und den Startvorlagen.
* Bestellungen aus Bold Product Options und Infinite Options ergänzen `line_item.options`, `line_item.option_addon`, `line_item.option_addons` sowie Preise inklusive Zusatzoptionen, sodass Sie kostenpflichtige Zusatzoptionen unter ihrem Artikel drucken können. Siehe [Apps für Produktoptionen (Bold, Infinite Options)](https://foliant-help.iforiti.com/de/templates/product-options-apps.md).

## Verwandte Artikel

* [Das Bestellobjekt und häufige Variablen](https://foliant-help.iforiti.com/de/template-editor/liquid-order-variables.md)
* [Geld und Währung in Vorlagen](https://foliant-help.iforiti.com/de/template-editor/liquid-money-and-currency.md)
* [Bestellattribute und Eigenschaften von Artikelpositionen](https://foliant-help.iforiti.com/de/template-editor/liquid-custom-fields.md)
* [Metafelder in Vorlagen](https://foliant-help.iforiti.com/de/template-editor/metafields.md)
* [Apps für Produktoptionen (Bold, Infinite Options)](https://foliant-help.iforiti.com/de/templates/product-options-apps.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.