nenad
12. April 2022 um 12:18
1
Guten Tag
Damit der Herstellername im Produkt Listing angezeigt wird habe ich das Twig Template /storefront/component/product/card/box-standard.html.twig überschrieben und folgendermassen den Produkt Name Block angepasst:
{% block component_product_box_name %}
<span class="product-manufacturer">{{ product.manufacturer.translated.name }}</span>
<a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
class="product-name"
title="{{ name }}">
{{ name }}
</a>
{% endblock %}
Im Listing funktioniert das auch wunderbar, in den Produkt Slidern zeigt es mir aber nur das HTML Markup an, ohne Inhalt. Wieso liefert {{ product.manufacturer.translated.name }} kein Resultat im Produkt Slider?
Was muss ich hier noch machen, damit es an beiden Orten angezeigt wird.
Danke
2 „Gefällt mir“
So konnte ich es bei mir einbinden (s. 4. zeile), im Grunde nur zum testen:
{% sw_extends '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
{% block component_product_box_price %}
<div class="product-price-wrapper">
{{ product.manufacturer.translated.name }}
{% set price = real %}
{% set isListPrice = price.listPrice.percentage > 0 %}
{% set isRegulationPrice = price.regulationPrice != null %}
<div class="product-cheapest-price{% if isListPrice and isRegulationPrice and not displayFrom and not displayFromVariants %} with-list-price{% endif %}{% if isRegulationPrice and not displayFrom and displayFromVariants %} with-regulation-price{% endif %}{% if displayFrom and isRegulationPrice %} with-from-price{% endif %}">
{% if cheapest.unitPrice != real.unitPrice and cheapest.variantId != product.id %}
<div>
{{ 'listing.cheapestPriceLabel'|trans|sw_sanitize }}
<span class="product-cheapest-price-price">
{{ cheapest.unitPrice|currency }}{{ 'general.star'|trans|sw_sanitize }}
</span>
</div>
{% endif %}
</div>
{# Neuer DIV Bereich um Preis & ab / from in eine Zeile zu packen #}
<div class="g2g-product-price-box">
{% if displayFrom or (displayParent and hasDifferentPrice and totalVariants|length > 1) %}
<div class="g2g-listing-from-text">
{{ 'listing.listingTextFrom'|trans|sw_sanitize }}
</div>
{% endif %}
<div class="product-price{% if isListPrice and not displayFrom and not displayFromVariants %} with-list-price{% endif %}">
{{ price.unitPrice|currency }}{{ 'general.star'|trans|sw_sanitize }}
{% if isListPrice and not displayFrom and not displayFromVariants %}
{% set afterListPriceSnippetExists = 'listing.afterListPrice'|trans|length > 0 %}
{% set beforeListPriceSnippetExists = 'listing.beforeListPrice'|trans|length > 0 %}
{% set hideStrikeTrough = beforeListPriceSnippetExists or afterListPriceSnippetExists %}
<span class="list-price{% if hideStrikeTrough %} list-price-no-line-through{% endif %}">
{% if beforeListPriceSnippetExists %}{{ 'listing.beforeListPrice'|trans|trim|sw_sanitize }}{% endif %}
<span class="list-price-price">{{ price.listPrice.price|currency }}{{ 'general.star'|trans|sw_sanitize }}</span>
{% if afterListPriceSnippetExists %}{{ 'listing.afterListPrice'|trans|trim|sw_sanitize }}{% endif %}
<span class="list-price-percentage">{{ 'detail.listPricePercentage'|trans({'%price%': price.listPrice.percentage })|sw_sanitize }}</span>
</span>
{% endif %}
</div>
{% if isRegulationPrice %}
<div class="product-price with-regulation-price">
{% if isListPrice %}<br>{% endif %}<span class="regulation-price">{{ 'general.listPricePreviously'|trans({'%price%': price.regulationPrice.price|currency }) }}{{ 'general.star'|trans|sw_sanitize }}</span>
</div>
{% endif %}
</div>
</div>
{% endblock %}
kathi
26. November 2024 um 11:21
4
Sollte das Problem noch nicht behoben sein, vielleicht hilft ja meine Antwort in Product-Properties in Produkt-Slider - #40 von kathi