{% sw_extends '@Storefront/storefront/page/product-detail/properties.html.twig' %}
{% block page_product_detail_properties_container %}
<div class="row product-detail-properties-container col-12">
<div class="table-responsive" style="width:100%">
{% block page_product_detail_properties_table %}
<table class="table product-detail-properties-table scsw-pd-properties-table">
<tbody>
{# @var product \Shopware\Core\Content\Product\SalesChannel\SalesChannelProductEntity #}
{% set properties = page.product.extensions.properties.property_options %}
{% block page_product_detail_properties_table_row %}
{% if subset == "pr" %}
{# dump( page.product) #}
{% set prices = page.product.calculatedPrices %}
{# dump(prices) #}
<tr class="properties-row">
<th class="properties-label" style="text-align: right;">{{ "steinco.quantity"|trans|sw_sanitize }}</th>
<td class="properties-label" style="font-weight: 700; width: 20rem; text-align: right; padding-right: 2rem; border-right: rgba(0, 0, 0, .1) solid 1px;">{{ "steinco.prices.pricePerUnit"|trans|sw_sanitize }}</td>
<td class="properties-label" style="font-weight: 700; text-align: left;">{{ "steinco.availability.title"|trans|sw_sanitize }}</td>
</tr>
{#% for price in prices %#}
{# dump(prices) #}
{% set quantity = 1 %}
{% for price in prices|sort((a, b) => a.quantity <=> b.quantity) %}
{# dump(price) #}
<tr class="properties-row">
<th class="properties-label" style="text-align: right;">{{ "steinco.prices.quantity"|trans({'%count%': quantity}) }}</th>
<td class="properties-value scsw-pd-property-value" style="width: 20rem; text-align: right; padding-right: 2rem; border-right: rgba(0, 0, 0, .1) solid 1px;">
{{ price.unitPrice|currency }} ({{ (price.unitPrice * (1 + (price.taxRules.first.taxRate / 100)))|currency }})
{# % for calculatedTax in price.calculatedTaxes.sortByTax %}
{{ calculatedTax.taxRate }}
{{ calculatedTax.tax|currency(currencyIsoCode) }}
{% endfor % #}
</td>
<td class="properties-value scsw-pd-property-value" style="text-align: left;">
{% if quantity <= page.product.availableStock %}
{% set text = "steinco.availability.now"|trans %}
{% set color = 'MediumSeaGreen' %}
{% else %}
{% set text = "steinco.availability.soon"|trans %}
{% set color = 'Gold' %}
{% endif %}
<div style="float:left; width: 1rem; height: 1rem; border-radius: 2rem; background-color: {{ color }}; margin-right: 0.5rem; "></div>
<div style="float:left; text-align: left;">{{ text }}</div>
</td>
</tr>
{% set quantity = price.quantity + 1 %} {# start der nächsten Rabattstufe #}
{% endfor %}
{% endif %}
{% if subset == "te" %}
{% if isZubehoer %}
{% set prop = properties['Produktart'] %}
{% if prop and prop.value is not sc_empty %}
<tr class="properties-row">
<th class="properties-label">{{ prop.name|e }}</th>
<td class="properties-value scsw-pd-property-value">{{ prop.value|e }}</td>
</tr>
{% endif %}
{% if properties['Gewicht_pro_Stk'].value is not sc_empty %}
<tr class="properties-row">
<th class="properties-label">
{% set val = "steinco.property.label.gewicht"|trans({
'%value1%': properties['Gewicht_pro_Stk'].value,
'%value2%': properties['Gewicht_ME'].value}) %}
{{ val|replace({'|': '</th><td class="properties-value scsw-pd-property-value">'})|raw }}
</td>
</tr>
{% endif %}
{% else %}
{% set prop = isRolle ? properties['Rolle_Tragkraft_kg'] : properties['Rad_Tragkraft_kg'] %}
{% if prop and prop.value is not sc_empty %}
<tr class="properties-row">
<th class="properties-label">
{% set val = "steinco.property.label.traglast_dynamisch"|trans({'%value1%': prop.value}) %}
{{ val|replace({'|': '</th><td class="properties-value scsw-pd-property-value">'})|raw }}
</td></tr>
{% endif %}
{% set prop = isRolle ? properties['Rolle_Traglast_Statisch_kg'] : properties['Rad_Traglast_Statisch_kg'] %}
{% if prop and prop.value is not sc_empty %}
<tr class="properties-row">
<th class="properties-label">
{% set val = "steinco.property.label.traglast_statisch"|trans({'%value1%': prop.value}) %}
{{ val|replace({'|': '</th><td class="properties-value scsw-pd-property-value">'})|raw }}
</td></tr>
{% endif %}
{% set prop1 = isRolle ? properties['Rolle_Temperatur_Bereich_von_C'] :
isZubehoer ? properties['Temperatur_Bereich_von_C'] :properties['Rad_Temperatur_Bereich_von_C'] %}
{% set prop2 = isRolle ? properties['Rolle_Temperatur_Bereich_bis_C'] :
isZubehoer ? properties['Temperatur_Bereich_bis_C'] :properties['Rad_Temperatur_Bereich_bis_C'] %}
{% if prop1 and prop1.value is not sc_empty and prop2 and prop2.value is not sc_empty %}
<tr class="properties-row">
<th class="properties-label">
{% set val = "steinco.property.label.temperaturbereich"|trans({
'%value1%': prop1.value,
'%value2%': prop2.value}) %}
{{ val|replace({'|': '</th><td class="properties-value scsw-pd-property-value">'})|raw }}
</td></tr>
{% endif %}
{% endif %}
{% if (properties['Konformitaet_RoHS'].value is sc_yes) or (properties['Konformitaet_Reach'].value is sc_yes) %}
<tr class="properties-row">
<th class="properties-label">
{% set val, comma = "", "" %}
{% if properties['Konformitaet_RoHS'].value is sc_yes %}
{% set val = "steinco.property.label.konformitaet"|trans({'%value1%': "steinco.property.rohs"|trans}) %}
{% set comma = ", " %}
{% endif %}
{% if properties['Konformitaet_Reach'].value is sc_yes %}
{% set val = val ~ comma ~ "steinco.property.reach"|trans %}
{% endif %}
{{ val|replace({'|': '</th><td class="properties-value scsw-pd-property-value">'})|raw }}
</td></tr>
{% endif %}
{% set norm = "steinco.property.label.norm"|trans %}
{% if properties['Norm1'].value is not sc_empty and properties['Norm1'].value != "0" %}
<tr class="properties-row">
<th class="properties-label">
{% set val = norm|trans({'%value1%': properties['Norm1'].value}) %}
{{ val|replace({'|': '</th><td class="properties-value scsw-pd-property-value">'})|raw }}
{% set norm = "|%value1%" %}
</td></tr>
{% endif %}
{% if properties['Norm2'].value is not sc_empty and properties['Norm2'].value != "0" %}
<tr class="properties-row">
<th class="properties-label">
{% set val = norm|trans({'%value1%': properties['Norm2'].value}) %}
{{ val|replace({'|': '</th><td class="properties-value scsw-pd-property-value">'})|raw }}
{% set norm = "|%value1%" %}
</td></tr>
{% endif %}
{% if properties['Norm3'].value is not sc_empty and properties['Norm3'].value != "0" %}
<tr class="properties-row">
<th class="properties-label">
{% set val = norm|trans({'%value1%': properties['Norm3'].value}) %}
{{ val|replace({'|': '</th><td class="properties-value scsw-pd-property-value">'})|raw }}
{% set norm = "|%value1%" %}
</td></tr>
{% endif %}
{% endif %}
{% if subset == "tz" %}
{# ==== Technische Daten "Zubehör" ==== #}
{% set items = [
"Durchmesser_mm",
"Laenge_mm",
"Anschluss",
"Material",
"Material_Farbe",
"Zubehoer",
] %}
{% for item in items %}
{% if (properties[item].value is not sc_empty) and (properties[item].value is not sc_null) %}
<tr class="properties-row">
<th class="properties-label">{{ properties[item].name|e }}</th>
<td class="properties-value scsw-pd-property-value">{{ properties[item].value|e }}</td>
</tr>
{% endif %}
{% endfor %}
{% endif %}
{% if subset == "tr" %}
{# ==== Technische Daten "Rad" ==== #}
<tr class="properties-row">
<th class="properties-label">{{ "steinco.wheel"|trans|sw_sanitize }}</th>
<td class="properties-value scsw-pd-property-value"></td>
</tr>
{% set items = [
"Rad_Durchmesser_mm",
"Rad_Lager_Kundenfilter",
"Rad_Achsdurchmesser_mm",
"Rad_Material",
"Rad_Nabenlaenge_mm",
"Rad_Breite_mm",
"Rad_Haerte",
"Rad_Bereifung"
] %}
{% for item in items %}
{% if properties[item].value is not sc_empty %}
<tr class="properties-row">
<th class="properties-label sc-normal sc-indent">{{ properties[item].name|e }}</th>
<td class="properties-value scsw-pd-property-value">{{ properties[item].value|e }}</td>
</tr>
{% endif %}
{% endfor %}
{% endif %}
{% if subset == "td" %}
{# ===== RAD ===== #}
<tr class="properties-row">
<th class="properties-label">{{ "steinco.wheel"|trans|sw_sanitize }}</th>
<td class="properties-value scsw-pd-property-value"></td>
</tr>
{% set items = [
"Rad_Bereifung",
"Rad_Breite_mm",
"Rad_Durchmesser_mm",
"Rolle_Coverfarbe",
"Rad_Felge_Farbe",
"Rad_Felge_Material",
"Rad_Haerte",
"Rad_Lager_Kundenfilter"
] %}
{% for item in items %}
{% if properties[item].value is not sc_empty %}
<tr class="properties-row">
<th class="properties-label sc-normal sc-indent">{{ properties[item].name|e }}</th>
<td class="properties-value scsw-pd-property-value">{{ properties[item].value|e }}</td>
</tr>
{% endif %}
{% endfor %}
{# ===== ROLLE ===== #}
<tr class="properties-row">
<th class="properties-label">{{ "steinco.castor"|trans|sw_sanitize }}</th>
<td class="properties-value scsw-pd-property-value"></td>
</tr>
{% set items = [
"Rolle_Achse",
"Rolle_Ausladung_mm",
"Rolle_Stoerkreisradius_mm",
"Rolle_Abweisrad_mm",
"Rolle_Bauart_Kundenfilter",
"Gabel_Rueckenlager_Kundenfilter",
"Rolle_Bauhoehe_mm",
"Rolle_Fadenschutz",
"Rolle_HauptFarbe",
"Rolle_Kabelabweiser",
"Rolle_Logo",
"Rolle_Gehaeuse_Material",
"Rolle_istLeitfaehig",
"Rolle_istMRTFaehig",
"Rolle_istRostfrei",
"Rolle_istWaschbar"
] %}
{% set techInfoLinks = [
"Rolle_istLeitfaehig",
"Rolle_istWaschbar"
] %}
{% for item in items %}
{% if properties[item].value is not sc_empty %}
<tr class="properties-row">
<th class="properties-label sc-normal sc-indent">{{ properties[item].name|e }}</th>
<td class="properties-value scsw-pd-property-value">{{ properties[item].value|e }}
{% if item in techInfoLinks %}
<a href="{{ "steinco.link.techInfo"|trans }}"></a>
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
{% if properties['Gewicht_pro_Stk'].value is not sc_empty %}
<tr class="properties-row">
<th class="properties-label sc-normal sc-indent">
{% set val = "steinco.property.label.gewicht"|trans({
'%value1%': properties['Gewicht_pro_Stk'].value,
'%value2%': properties['Gewicht_ME'].value}) %}
{{ val|replace({'|': '</th><td class="properties-value scsw-pd-property-value">'})|raw }}
</td></tr>
{% endif %}
{# ===== BEFESTIGUNG ===== #}
{% set items = [
"Befestigung_Abmessungen_Gruppe",
"Befestigung_Abmessung_Kundenfilter",
"Befestigung_Rohr",
"Befestigung_Spreizabmessungen"
] %}
{% set showIt = false %}
{% for item in items %}
{% if properties[item].value is not sc_empty %}
{% set showIt = true %}
{% endif %}
{% endfor %}
{% if showIt %}
<tr class="properties-row">
<th class="properties-label">{{ "steinco.attachment"|trans|sw_sanitize }}</th>
<td class="properties-value scsw-pd-property-value"></td>
</tr>
{% for item in items %}
{% if properties[item].value is not sc_empty %}
<tr class="properties-row">
<th class="properties-label sc-normal sc-indent">{{ properties[item].name|e }}</th>
<td class="properties-value scsw-pd-property-value">{{ properties[item].value|e }}</td>
</tr>
{% endif %}
{% endfor %}
{% endif %}
{# ===== FESTSTELLER ===== #}
{% set items = [
"Feststeller_Art",
"Feststeller_Auftruck",
"Feststeller_Farbe",
"Feststeller_ZentraleSteuerbarkeit_Kundenfilter"
] %}
{% set showIt = false %}
{% for item in items %}
{% if properties[item].value is not sc_empty %}
{% set showIt = true %}
{% endif %}
{% endfor %}
{% if showIt %}
<tr class="properties-row">
<th class="properties-label">{{ "steinco.lock"|trans|sw_sanitize }}</th>
<td class="properties-value scsw-pd-property-value"></td>
</tr>
{% for item in items %}
{% if properties[item].value is not sc_empty %}
<tr class="properties-row">
<th class="properties-label sc-normal sc-indent">{{ properties[item].name|e }}</th>
<td class="properties-value scsw-pd-property-value">{{ properties[item].value|e }}</td>
</tr>
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% if subset == "all" %}
{% for key in properties|keys|sort %}
<tr class="properties-row">
<th class="properties-label">{{ properties[key].name|trans|e }} <span style="font-weight: 400; font-size: 10px; color: darkgray;">[{{ key|e }}]</span></th>
<td class="properties-value scsw-pd-property-value">{{ properties[key].value|trans|e }}</td>
</tr>
{% endfor %}
{% endif %}
{% endblock %}
</tbody>
</table>
{% endblock %}
</div>
</div>
{% endblock %}