# Varianten-Artikel nutzbar machen

**URL:** <https://forum.shopware.com/t/varianten-artikel-nutzbar-machen/85762>\
**Category:** Shopware 6 (German)\
**Created:** [6. März 2021 um 15:53 UTC](https://forum.shopware.com/t/varianten-artikel-nutzbar-machen/85762 "2021-03-06T15:53:06Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![siebi](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@siebi](https://forum.shopware.com/u/siebi)\
**Post date:** [13. März 2021 um 14:39 UTC](https://forum.shopware.com/t/varianten-artikel-nutzbar-machen/85762/7 "2021-03-13T14:39:19Z")

</div>

Ich glaube ich habe die Lösung gefunden, damit der Detail-Button ausgespielt wird, wenn es sich um eine Variante handelt - auch wenn die Variante als „Einzelne Hauptvariante“ ausgewählt wurde.  
In der:  
`/component/product/card/action.html.twig`

Nach:  
` {% set isAvailable = not product.isCloseout or (product.availableStock >= product.minPurchase) %}`  
Einfügen:  
`{% set variant = product.parentId is not null %}`

Ersetze:  
` {% if isAvailable and not product.isGrouped and product.childCount <= 0 and product.calculatedPrices.count <= 1 %}`  
Mit:  
` {% if isAvailable and not product.isGrouped and product.childCount <= 0 and product.calculatedPrices.count <= 1 and not variant %}`

So kann man bei Varianten-Produkten den Hauptartikel festlegen und dennoch wird nicht der Warenkorb- sondern der Detail-Button angezeigt. Der Kunde sieht also besser, dass es Varianten gibt.  
Am einfachsten setzt man die Änderung mit dem Plugin

> **[Custom Template Manager](https://store.shopware.com/dne5116914822923f/custom-template-manager.html?c=1111)**
>
> Fügt der Administration eine Bearbeitungsfunktion hinzu, die es ermöglicht die Templates des Storefronts direkt innerhalb der Administration mit…

um. So ist das ganze auch Updatesicher und recht einfach.

Änderungen natürlich auf eigene Gefahr 😉

---

_[View the full topic](https://forum.shopware.com/t/varianten-artikel-nutzbar-machen/85762)._
