custom/plugins/MyParto/src/Resources/views/storefront/component/product/card/price-unit.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
    
    {% block component_product_box_price %}
        <div class="product-price-wrapper">
            {% set price = real %}
    
            <div class="product-cheapest-price">
                {% if cheapest.unitPrice != real.unitPrice %}
                    <div>{{ "listing.cheapestPriceLabel"|trans|sw_sanitize }}<span class="product-cheapest-price-price"> {{ cheapest.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}</span></div>
                {% endif %}
            </div>
    
            {% if displayFrom %}
                {{ "listing.listingTextFrom"|trans|sw_sanitize }}
            {% endif %}
    
            {% set isListPrice = price.listPrice.percentage > 0 %}
    
            <span class="product-price{% if isListPrice and not displayFrom %} with-list-price{% endif %}">
                {% if isListPrice and not displayFrom %}
                    {% 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 %}">
                        <span class="list-price-price">statt {{ price.listPrice.price|currency }}</span>
                    </span>
                {% endif %}
    
                {{ price.unitPrice|currency }}
            </span>
        </div>
    {% endblock %}
    
    
    
    {% block component_product_box_price_unit %}
        {% if ( purchaseUnit and purchaseUnit != 0 ) or referncePrice is not null %}
    
    
            {% if purchaseUnit or referncePrice %}
            <p class="product-price-unit">
                {# Price is based on the purchase unit #}
                {% block component_product_box_price_purchase_unit %}
                    {% if purchaseUnit and purchaseUnit != 0 %}
                        <span class="product-unit-label">
                        {{ "listing.boxUnitLabel"|trans|sw_sanitize }}
                    </span>
                        <span class="price-unit-content">
                        {{ purchaseUnit }} {{ product.unit.translation('name') }}
                    </span>
                    {% endif %}
                {% endblock %}
    
                {# Item price is based on a reference unit #}
                {% block component_product_box_price_reference_unit %}
                    {% if referncePrice is not null %}
                        <span class="price-unit-reference">
                        {% if (product.priceRange and product.isGrouped) or product.calculatedPrices.count > 1 %}
                            ({{ "listing.listingTextFrom"|trans|sw_sanitize }} {{ fromPrice.referencePrice.price|currency }}{{ "general.star"|trans|sw_sanitize }} / {{ fromPrice.referencePrice.referenceUnit }}&nbsp;{{ fromPrice.referencePrice.unitName }})
                        {% else %}
                            ({{ referncePrice.price|currency }}{{ "general.star"|trans|sw_sanitize }} / {{ referncePrice.referenceUnit }} {{ referncePrice.unitName }})
                        {% endif %}
                    </span>
                    {% endif %}
                {% endblock %}
            {% endif %}
            </p>
        {% endif %}
    {% endblock %}