Skip to main content

Commerce Variants

Abrufen der Produkte von Varianten, die einem Entry zugewiesen sind.

Terry Upton asks on Discord: So I have some entries that have a lot of related product variants. Speaking of variants, not products.

I want to be able to just show the products of those variants and not each variant.

{% set variants = entry.relatedProducts %}
{% set products = craft.products.hasVariant(variants).all() %}

{% for product in products %}
  {% include 'shop/_routers/product.twig' %}
{% endfor %}