# Abfrage "is Sale" in price-unit.html.twig

**URL:** <https://forum.shopware.com/t/abfrage-is-sale-in-price-unit-html-twig/108526>\
**Category:** Programmierung\
**Created:** [29. Januar 2026 um 15:39 UTC](https://forum.shopware.com/t/abfrage-is-sale-in-price-unit-html-twig/108526 "2026-01-29T15:39:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ingenious\_design](https://avatars.discourse-cdn.com/v4/letter/i/db5fbb/32.png) [@ingenious\_design](https://forum.shopware.com/u/ingenious_design)\
**Post date:** [29. Januar 2026 um 15:39 UTC](https://forum.shopware.com/t/abfrage-is-sale-in-price-unit-html-twig/108526/1 "2026-01-29T15:39:06Z")

</div>

Hallo zusammen,

ist es möglich, im Template box-standard.html.twig oder in price-unit.html.twig eine CSS-Klasse oder eine Abfrage wie z. B. “isOnSale” einzufügen? Habe dazu in der Doku und dem Github Repo leider nichts gefunden.

---

<div class="post-metadata">

**Author:** ![Max\_Shop](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Max\_Shop](https://forum.shopware.com/u/Max_Shop)\
**Post date:** [29. Januar 2026 um 15:57 UTC](https://forum.shopware.com/t/abfrage-is-sale-in-price-unit-html-twig/108526/2 "2026-01-29T15:57:19Z")

</div>

> <https://github.com/shopware/shopware/blob/e9b3ebb89006e3c8674bca1f9ea6564ab5592788/src/Storefront/Resources/views/storefront/component/product/block-price.html.twig>

Ein Sale gibt es bei Shopware nicht. Es gibt nur einen ListPrice, der dann den durchgestrichenen Preis und den prozentualen Rabatt erzeugt.

---

<div class="post-metadata">

**Author:** ![MrAle](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@MrAle](https://forum.shopware.com/u/MrAle)\
**Post date:** [30. Januar 2026 um 07:18 UTC](https://forum.shopware.com/t/abfrage-is-sale-in-price-unit-html-twig/108526/3 "2026-01-30T07:18:58Z")

</div>

`{% sw_extends ‚@Storefront/storefront/component/product/card/price-unit.html.twig‘ %}`  
`{% block component_product_box_main_price %}`  
`{% if isListPrice %}`  
` {{parent()}}`  
`{% else %}`  
` {{parent()}}`  
`{% endif %}`  
`{% endblock %}`

Je nachdem was du vor hast, könnte das helfen 🙂 Kannst natürlich die Klasse auch schon in ein bestehendes Element schreiben anstatt eine neue div aufzumachen

LG

---

<div class="post-metadata">

**Author:** ![ingenious\_design](https://avatars.discourse-cdn.com/v4/letter/i/db5fbb/32.png) [@ingenious\_design](https://forum.shopware.com/u/ingenious_design)\
**Post date:** [9. Februar 2026 um 11:30 UTC](https://forum.shopware.com/t/abfrage-is-sale-in-price-unit-html-twig/108526/4 "2026-02-09T11:30:12Z")

</div>

Hi zusammen,

danke für die Lösungsvorschläge 🙂 Aber ganz klappen tut es immer noch nicht.  
Es geht mir hauptsächlich darum diesen Part hier auszublenden, wenn der Artikel nicht reduziert ist:

```auto
<span class="regulation-price">vorher 99,90&nbsp;€</span>

```

Gibt es dafür eine Bedingung? Denn bei allen reduzierten Artikeln soll der Regulation Price noch angezeigt werden. Aktuell ist er sowohl bei reduzierten, als auch bei regulären Artikeln sichtbar.

---

<div class="post-metadata">

**Author:** ![MrAle](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@MrAle](https://forum.shopware.com/u/MrAle)\
**Post date:** [9. Februar 2026 um 12:50 UTC](https://forum.shopware.com/t/abfrage-is-sale-in-price-unit-html-twig/108526/5 "2026-02-09T12:50:11Z")

</div>

Hey,

```auto
{% if isRegulationPrice && product.price|first.regulationPrice.gross > product.price|first.gross %}
                    <span class="product-price with-regulation-price">
                        {# @deprecated tag:v6.7.0 - Showing asterisk next to every price is deprecated. Tax and shipping info is displayed as text instead if `allowBuyInListing` is true. #}
                        {% if isListPrice %}<br>{% endif %}
                        <span class="regulation-price">{{ 'general.listPricePreviously'|trans({'%price%': price.regulationPrice.price|currency }) }}
                            {% if not feature('ACCESSIBILITY_TWEAKS') %}
                                {{ 'general.star'|trans|sw_sanitize }}
                            {% endif %}
                        </span>
                    </span>
                {% endif %}

```

Schau mal ob ich dich da richtig verstanden habe.

Grüße

---

<div class="post-metadata">

**Author:** ![Max\_Shop](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Max\_Shop](https://forum.shopware.com/u/Max_Shop)\
**Post date:** [9. Februar 2026 um 14:03 UTC](https://forum.shopware.com/t/abfrage-is-sale-in-price-unit-html-twig/108526/6 "2026-02-09T14:03:07Z")

</div>

Den |first Filter kannst du weglassen und direkt die Variablen price.regulationPrice.price bzw. price.unitPrice nutzen.

---

<div class="post-metadata">

**Author:** ![ingenious\_design](https://avatars.discourse-cdn.com/v4/letter/i/db5fbb/32.png) [@ingenious\_design](https://forum.shopware.com/u/ingenious_design)\
**Post date:** [10. Februar 2026 um 12:30 UTC](https://forum.shopware.com/t/abfrage-is-sale-in-price-unit-html-twig/108526/7 "2026-02-10T12:30:24Z")

</div>

> [@MrAle](#):
>
> ```auto
> {% if isRegulationPrice && product.price|first.regulationPrice.gross > product.price|first.gross %}
> <span class="product-price with-regulation-price">
> {# @deprecated tag:v6.7.0 - Showing asterisk next to every price is deprecated. Tax and shipping info is displayed as text instead if `allowBuyInListing` is true. #}
> {% if isListPrice %}<br>{% endif %}
> <span class="regulation-price">{{ 'general.listPricePreviously'|trans({'%price%': price.regulationPrice.price|currency }) }}
> {% if not feature('ACCESSIBILITY_TWEAKS') %}
> {{ 'general.star'|trans|sw_sanitize }}
> {% endif %}
> </span>
> </span>
> {% endif %}
> 
> ```

> Hi, das hat mir in der Tat weitergeholfen, allerdings musste ich den Regulation Price an zwei Stellen anpassen. Hier die vollständige Lösung falls jemand an einer ähnlichen Stelle hängt:
> 
> {% sw\_extends ‚@Storefront/storefront/component/buy-widget/buy-widget-price.html.twig‘ %}
> 
> _{# Regulation Preis nur bei Sale-Artikeln zeigen #}_
> 
> {% block buy\_widget\_price\_content %}
> 
> ```
> {% set listPrice = price.listPrice %}
> 
> {% set isListPrice = price.listPrice.percentage > 0 %}
> 
> {% set isRegulationPrice = price.regulationPrice != null %}
> 
> <p class="product-detail-price{% if isListPrice %} with-list-price{% endif %}{% if isRegulationPrice and isListPrice %} with-regulation-price{% endif %}">
> 
> {{ price.unitPrice|currency }}
> 
> </p>
> 
> {% if isListPrice %}
> 
> {% block buy_widget_was_price %}
> 
> {% block buy_widget_was_price_badge %}
> 
> <span class="list-price-badge">&#37;</span>
> 
> {% endblock %}
> 
> {% set afterListPriceSnippetExists = 'listing.afterListPrice'|trans|*length* > 0 %}
> 
> {% set beforeListPriceSnippetExists = 'listing.beforeListPrice'|trans|*length* > 0 %}
> 
> {% block buy_widget_was_price_wrapper %}
> 
> <span class="product-detail-list-price-wrapper">
> 
> {% if beforeListPriceSnippetExists %}{{ 'listing.beforeListPrice'|trans|*trim* }}{% endif %}
> 
> <span{% if not (afterListPriceSnippetExists or beforeListPriceSnippetExists) %} class="list-price-price"{% endif %}>
> 
> {{ listPrice.price|currency }}
> 
> </span>
> 
> {% if afterListPriceSnippetExists %}
> 
> {{ 'listing.afterListPrice'|trans|*trim* }}
> 
> {% endif %}
> 
> <span class="list-price-percentage">
> 
> {{ 'detail.listPricePercentage'|trans({'%price%': listPrice.percentage })|sw_sanitize }}
> 
> </span>
> 
> </span>
> 
> {% endblock %}
> 
> {% endblock %}
> 
> {% endif %}
> 
> *{# regulationPrice NUR bei Sale #}*
> 
> {% if isRegulationPrice and isListPrice %}
> 
> <span class="product-detail-list-price-wrapper">
> 
> <span class="regulation-price">
> 
> {{ 'general.listPricePreviously'|trans({'%price%': price.regulationPrice.price|currency }) }}
> 
> </span>
> 
> </span>
> 
> {% endif %}
> 
> ```
> 
> {% endblock %}

> {% sw\_extends ‚@Storefront/storefront/component/product/card/price-unit.html.twig‘ %}
> 
> {% block component\_product\_box\_regulation\_price %}
> 
> ```
> *{# regulationPrice nur anzeigen, wenn auch ein Sale (listPrice) aktiv ist #}*
> 
> {% if isRegulationPrice and isListPrice %}
> 
> <span class="product-price with-regulation-price">
> 
> <br aria-hidden="true">
> 
> <span class="regulation-price">
> 
> {{ 'general.listPricePreviously'|trans({'%price%': price.regulationPrice.price|currency }) }}
> 
> </span>
> 
> </span>
> 
> {% endif %}
> 
> ```

Danke für eure Hilfe.

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/3X/2/9/29c7587ba660f00e4995d1743162782e5d6d8653.svg) [@system](https://forum.shopware.com/u/system)\
**Post date:** [12. März 2026 um 12:31 UTC](https://forum.shopware.com/t/abfrage-is-sale-in-price-unit-html-twig/108526/8 "2026-03-12T12:31:20Z")

</div>

Dieses Thema wurde automatisch 30 Tage nach der letzten Antwort geschlossen. Es sind keine neuen Antworten mehr erlaubt.
