custom/plugins/SteincoTheme/src/Resources/views/storefront/page/product-detail/properties.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/product-detail/properties.html.twig' %}
  2. {% block page_product_detail_properties_container %}
  3.     <div class="row product-detail-properties-container col-12">
  4.         <div class="table-responsive" style="width:100%">
  5.             {% block page_product_detail_properties_table %}
  6.                 <table class="table product-detail-properties-table scsw-pd-properties-table">
  7.                     <tbody>
  8.                         {# @var product \Shopware\Core\Content\Product\SalesChannel\SalesChannelProductEntity #}
  9.                         {% set properties = page.product.extensions.properties.property_options %}
  10.                         {% block page_product_detail_properties_table_row %}
  11.                             {% if subset == "pr" %}
  12.                                 {# dump( page.product) #}
  13. {% set prices = page.product.calculatedPrices %}
  14. {# dump(prices) #}
  15.                                 <tr class="properties-row">
  16.                                     <th class="properties-label" style="text-align: right;">{{ "steinco.quantity"|trans|sw_sanitize }}</th>
  17.     <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>
  18.                                     <td class="properties-label" style="font-weight: 700; text-align: left;">{{ "steinco.availability.title"|trans|sw_sanitize }}</td>
  19.                                 </tr>
  20.                                 {#% for price in prices %#}
  21. {# dump(prices) #}
  22. {% set quantity = 1 %}
  23. {% for price in prices|sort((a, b) => a.quantity <=> b.quantity) %}
  24.     {# dump(price) #}
  25.                                     <tr class="properties-row">
  26.                                         <th class="properties-label" style="text-align: right;">{{ "steinco.prices.quantity"|trans({'%count%': quantity}) }}</th>
  27.                                         <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;">
  28.             {{ price.unitPrice|currency }} ({{ (price.unitPrice * (1 + (price.taxRules.first.taxRate / 100)))|currency }})
  29.                                             {# % for calculatedTax in price.calculatedTaxes.sortByTax %}
  30.                                                 {{ calculatedTax.taxRate }}
  31.                                                 {{ calculatedTax.tax|currency(currencyIsoCode) }}
  32.                                             {% endfor % #}
  33.                                         </td>
  34.                                         <td class="properties-value scsw-pd-property-value" style="text-align: left;">
  35.                                             {% if quantity <= page.product.availableStock %}
  36.                                                 {% set text = "steinco.availability.now"|trans %}
  37.                                                 {% set color = 'MediumSeaGreen' %}
  38.                                             {% else %}
  39.                                                 {% set text = "steinco.availability.soon"|trans %}
  40.                                                 {% set color = 'Gold' %}
  41.                                             {% endif %}
  42.                                             <div style="float:left; width: 1rem; height: 1rem; border-radius: 2rem; background-color: {{ color }}; margin-right: 0.5rem; "></div>
  43.                                             <div style="float:left; text-align: left;">{{ text }}</div>
  44.                                         </td>
  45.                                     </tr>
  46.     {% set quantity = price.quantity + 1 %} {# start der nächsten Rabattstufe #}
  47.                                 {% endfor %}
  48.                             {% endif %}
  49.                             {% if subset == "te" %}
  50.                                 {%  if isZubehoer %}
  51.                                     {% set prop = properties['Produktart'] %}
  52.                                     {% if prop and prop.value is not sc_empty %}
  53.                                         <tr class="properties-row">
  54.                                             <th class="properties-label">{{ prop.name|e }}</th>
  55.                                             <td class="properties-value scsw-pd-property-value">{{ prop.value|e }}</td>
  56.                                         </tr>
  57.                                     {% endif %}
  58.                                     {% if properties['Gewicht_pro_Stk'].value is not sc_empty %}
  59.                                         <tr class="properties-row">
  60.                                             <th class="properties-label">
  61.                                                 {% set val = "steinco.property.label.gewicht"|trans({
  62.                                                     '%value1%': properties['Gewicht_pro_Stk'].value,
  63.                                                     '%value2%': properties['Gewicht_ME'].value}) %}
  64.                                                 {{ val|replace({'|': '</th><td class="properties-value scsw-pd-property-value">'})|raw }}
  65.                                                 </td>
  66.                                         </tr>
  67.                                     {% endif %}
  68.                                 {% else %}
  69.                                     {% set prop = isRolle ? properties['Rolle_Tragkraft_kg'] : properties['Rad_Tragkraft_kg'] %}
  70.                                     {% if prop and prop.value is not sc_empty %}
  71.                                             <tr class="properties-row">
  72.                                                 <th class="properties-label">
  73.                                                 {% set val = "steinco.property.label.traglast_dynamisch"|trans({'%value1%': prop.value}) %}
  74.                                                 {{ val|replace({'|': '</th><td class="properties-value scsw-pd-property-value">'})|raw }}
  75.                                             </td></tr>
  76.                                     {% endif %}
  77.                                     {% set prop = isRolle ? properties['Rolle_Traglast_Statisch_kg'] : properties['Rad_Traglast_Statisch_kg'] %}
  78.                                     {% if prop and prop.value is not sc_empty %}
  79.                                             <tr class="properties-row">
  80.                                                 <th class="properties-label">
  81.                                                 {% set val = "steinco.property.label.traglast_statisch"|trans({'%value1%': prop.value}) %}
  82.                                                 {{ val|replace({'|': '</th><td class="properties-value scsw-pd-property-value">'})|raw }}
  83.                                             </td></tr>
  84.                                     {% endif %}
  85.                                     {% set prop1 = isRolle ? properties['Rolle_Temperatur_Bereich_von_C'] :
  86.                                             isZubehoer ? properties['Temperatur_Bereich_von_C'] :properties['Rad_Temperatur_Bereich_von_C'] %}
  87.                                     {% set prop2 = isRolle ? properties['Rolle_Temperatur_Bereich_bis_C'] :
  88.                                             isZubehoer ? properties['Temperatur_Bereich_bis_C'] :properties['Rad_Temperatur_Bereich_bis_C'] %}
  89.                                     {% if prop1 and prop1.value is not sc_empty and prop2 and prop2.value is not sc_empty %}
  90.                                             <tr class="properties-row">
  91.                                                 <th class="properties-label">
  92.                                                 {% set val = "steinco.property.label.temperaturbereich"|trans({
  93.                                                         '%value1%': prop1.value,
  94.                                                         '%value2%': prop2.value}) %}
  95.                                                 {{ val|replace({'|': '</th><td class="properties-value scsw-pd-property-value">'})|raw }}
  96.                                             </td></tr>
  97.                                     {% endif %}
  98.                                 {% endif %}
  99.                                 {% if (properties['Konformitaet_RoHS'].value is sc_yes) or (properties['Konformitaet_Reach'].value is sc_yes) %}
  100.                                         <tr class="properties-row">
  101.                                             <th class="properties-label">
  102.                                         {% set val, comma = "", "" %}
  103.                                         {% if properties['Konformitaet_RoHS'].value is sc_yes %}
  104.                                             {% set val = "steinco.property.label.konformitaet"|trans({'%value1%': "steinco.property.rohs"|trans}) %}
  105.                                             {% set comma = ", " %}
  106.                                         {% endif %}
  107.                                         {% if properties['Konformitaet_Reach'].value is sc_yes %}
  108.                                             {% set val = val ~ comma ~ "steinco.property.reach"|trans %}
  109.                                         {% endif %}
  110.                                             {{ val|replace({'|': '</th><td class="properties-value scsw-pd-property-value">'})|raw }}
  111.                                         </td></tr>
  112.                                 {% endif %}
  113.                                 {% set norm = "steinco.property.label.norm"|trans %}
  114.                                 {% if properties['Norm1'].value is not sc_empty and properties['Norm1'].value != "0" %}
  115.                                         <tr class="properties-row">
  116.                                             <th class="properties-label">
  117.                                             {% set val = norm|trans({'%value1%': properties['Norm1'].value}) %}
  118.                                             {{ val|replace({'|': '</th><td class="properties-value scsw-pd-property-value">'})|raw }}
  119.                                             {% set norm = "|%value1%" %}
  120.                                         </td></tr>
  121.                                 {% endif %}
  122.                                 {% if properties['Norm2'].value is not sc_empty and properties['Norm2'].value != "0" %}
  123.                                         <tr class="properties-row">
  124.                                             <th class="properties-label">
  125.                                             {% set val = norm|trans({'%value1%': properties['Norm2'].value}) %}
  126.                                             {{ val|replace({'|': '</th><td class="properties-value scsw-pd-property-value">'})|raw }}
  127.                                             {% set norm = "|%value1%" %}
  128.                                         </td></tr>
  129.                                 {% endif %}
  130.                                 {% if properties['Norm3'].value is not sc_empty and properties['Norm3'].value != "0" %}
  131.                                         <tr class="properties-row">
  132.                                             <th class="properties-label">
  133.                                             {% set val = norm|trans({'%value1%': properties['Norm3'].value}) %}
  134.                                             {{ val|replace({'|': '</th><td class="properties-value scsw-pd-property-value">'})|raw }}
  135.                                             {% set norm = "|%value1%" %}
  136.                                         </td></tr>
  137.                                 {% endif %}
  138.                             {% endif %}
  139.                             {% if subset == "tz" %}
  140.                                 {# ==== Technische Daten "Zubehör" ==== #}
  141.                                 {% set items = [
  142.                                     "Durchmesser_mm",
  143.                                     "Laenge_mm",
  144.                                     "Anschluss",
  145.                                     "Material",
  146.                                     "Material_Farbe",
  147.                                     "Zubehoer",
  148.                                 ] %}
  149.                                 {% for item in items %}
  150.                                     {% if (properties[item].value is not sc_empty) and (properties[item].value is not sc_null) %}
  151.                                         <tr class="properties-row">
  152.                                             <th class="properties-label">{{ properties[item].name|e }}</th>
  153.                                             <td class="properties-value scsw-pd-property-value">{{ properties[item].value|e }}</td>
  154.                                         </tr>
  155.                                     {% endif %}
  156.                                 {% endfor %}
  157.                             {% endif %}
  158.                             {% if subset == "tr" %}
  159.                                 {# ==== Technische Daten "Rad" ==== #}
  160.                                 <tr class="properties-row">
  161.                                     <th class="properties-label">{{ "steinco.wheel"|trans|sw_sanitize }}</th>
  162.                                     <td class="properties-value scsw-pd-property-value"></td>
  163.                                 </tr>
  164.                                 {% set items = [
  165.                                     "Rad_Durchmesser_mm",
  166.                                     "Rad_Lager_Kundenfilter",
  167.                                     "Rad_Achsdurchmesser_mm",
  168.                                     "Rad_Material",
  169.                                     "Rad_Nabenlaenge_mm",
  170.                                     "Rad_Breite_mm",
  171.                                     "Rad_Haerte",
  172.                                     "Rad_Bereifung"
  173.                                 ] %}
  174.                                 {% for item in items %}
  175.                                     {% if properties[item].value is not sc_empty %}
  176.                                         <tr class="properties-row">
  177.                                             <th class="properties-label sc-normal sc-indent">{{ properties[item].name|e }}</th>
  178.                                             <td class="properties-value scsw-pd-property-value">{{ properties[item].value|e }}</td>
  179.                                         </tr>
  180.                                     {% endif %}
  181.                                 {% endfor %}
  182.                             {% endif %}
  183.                             {% if subset == "td" %}
  184.                                 {# ===== RAD ===== #}
  185.                                 <tr class="properties-row">
  186.                                     <th class="properties-label">{{ "steinco.wheel"|trans|sw_sanitize }}</th>
  187.                                     <td class="properties-value scsw-pd-property-value"></td>
  188.                                 </tr>
  189.                                 {% set items = [
  190.                                 "Rad_Bereifung",
  191.                                 "Rad_Breite_mm",
  192.                                 "Rad_Durchmesser_mm",
  193.                                 "Rolle_Coverfarbe",
  194.                                 "Rad_Felge_Farbe",
  195.                                 "Rad_Felge_Material",
  196.                                 "Rad_Haerte",
  197.                                 "Rad_Lager_Kundenfilter"
  198.                                 ] %}
  199.                                     {% for item in items %}
  200.                                         {% if properties[item].value is not sc_empty %}
  201.                                             <tr class="properties-row">
  202.                                                 <th class="properties-label sc-normal sc-indent">{{ properties[item].name|e }}</th>
  203.                                                 <td class="properties-value scsw-pd-property-value">{{ properties[item].value|e }}</td>
  204.                                             </tr>
  205.                                         {% endif %}
  206.                                     {% endfor %}
  207.                                 {# ===== ROLLE ===== #}
  208.                                 <tr class="properties-row">
  209.                                     <th class="properties-label">{{ "steinco.castor"|trans|sw_sanitize }}</th>
  210.                                     <td class="properties-value scsw-pd-property-value"></td>
  211.                                 </tr>
  212. {% set items = [
  213. "Rolle_Achse",
  214. "Rolle_Ausladung_mm",
  215. "Rolle_Stoerkreisradius_mm",
  216. "Rolle_Abweisrad_mm",
  217. "Rolle_Bauart_Kundenfilter",
  218. "Gabel_Rueckenlager_Kundenfilter",
  219. "Rolle_Bauhoehe_mm",
  220. "Rolle_Fadenschutz",
  221. "Rolle_HauptFarbe",
  222. "Rolle_Kabelabweiser",
  223. "Rolle_Logo",
  224. "Rolle_Gehaeuse_Material",
  225. "Rolle_istLeitfaehig",
  226. "Rolle_istMRTFaehig",
  227. "Rolle_istRostfrei",
  228. "Rolle_istWaschbar"
  229. ] %}
  230. {% set techInfoLinks = [
  231. "Rolle_istLeitfaehig",
  232. "Rolle_istWaschbar"
  233. ] %}
  234.                                     {% for item in items %}
  235.                                         {% if properties[item].value is not sc_empty %}
  236.                                             <tr class="properties-row">
  237.                                                 <th class="properties-label sc-normal sc-indent">{{ properties[item].name|e }}</th>
  238.                                                 <td class="properties-value scsw-pd-property-value">{{ properties[item].value|e }}
  239.                                                 {% if item in techInfoLinks %}
  240.                                                     <a href="{{ "steinco.link.techInfo"|trans }}"></a>
  241.                                                 {% endif %}
  242.                                                 </td>
  243.                                             </tr>
  244.                                         {% endif %}
  245.                                     {% endfor %}
  246.                                     {% if properties['Gewicht_pro_Stk'].value is not sc_empty %}
  247.                                         <tr class="properties-row">
  248.                                             <th class="properties-label sc-normal sc-indent">
  249.                                                 {% set val = "steinco.property.label.gewicht"|trans({
  250.                                                     '%value1%': properties['Gewicht_pro_Stk'].value,
  251.                                                     '%value2%': properties['Gewicht_ME'].value}) %}
  252.                                                 {{ val|replace({'|': '</th><td class="properties-value scsw-pd-property-value">'})|raw }}
  253.                                             </td></tr>
  254.                                     {% endif %}
  255.                                 {# ===== BEFESTIGUNG ===== #}
  256. {% set items = [
  257. "Befestigung_Abmessungen_Gruppe",
  258. "Befestigung_Abmessung_Kundenfilter",
  259. "Befestigung_Rohr",
  260. "Befestigung_Spreizabmessungen"
  261. ] %}
  262.                                 {% set showIt = false %}
  263.                                 {% for item in items %}
  264.                                     {% if properties[item].value is not sc_empty %}
  265.                                         {% set showIt = true %}
  266.                                     {% endif %}
  267.                                 {% endfor %}
  268.                                 {% if showIt %}
  269.                                     <tr class="properties-row">
  270.                                         <th class="properties-label">{{ "steinco.attachment"|trans|sw_sanitize }}</th>
  271.                                         <td class="properties-value scsw-pd-property-value"></td>
  272.                                     </tr>
  273.                                     {% for item in items %}
  274.                                         {% if properties[item].value is not sc_empty %}
  275.                                             <tr class="properties-row">
  276.                                                 <th class="properties-label  sc-normal sc-indent">{{ properties[item].name|e }}</th>
  277.                                                 <td class="properties-value scsw-pd-property-value">{{ properties[item].value|e }}</td>
  278.                                             </tr>
  279.                                         {% endif %}
  280.                                     {% endfor %}
  281.                                 {% endif %}
  282.                                 {# ===== FESTSTELLER ===== #}
  283. {% set items = [
  284. "Feststeller_Art",
  285. "Feststeller_Auftruck",
  286. "Feststeller_Farbe",
  287. "Feststeller_ZentraleSteuerbarkeit_Kundenfilter"
  288. ] %}
  289.                                 {% set showIt = false %}
  290.                                 {% for item in items %}
  291.                                     {% if properties[item].value is not sc_empty %}
  292.                                         {% set showIt = true %}
  293.                                     {% endif %}
  294.                                 {% endfor %}
  295.                                 {% if showIt %}
  296.                                     <tr class="properties-row">
  297.                                         <th class="properties-label">{{ "steinco.lock"|trans|sw_sanitize }}</th>
  298.                                         <td class="properties-value scsw-pd-property-value"></td>
  299.                                     </tr>
  300.                                     {% for item in items %}
  301.                                         {% if properties[item].value is not sc_empty %}
  302.                                             <tr class="properties-row">
  303.                                                 <th class="properties-label  sc-normal sc-indent">{{ properties[item].name|e }}</th>
  304.                                                 <td class="properties-value scsw-pd-property-value">{{ properties[item].value|e }}</td>
  305.                                             </tr>
  306.                                         {% endif %}
  307.                                     {% endfor %}
  308.                                 {% endif %}
  309.                             {% endif %}
  310.                             {% if subset == "all" %}
  311.                                 {% for key in properties|keys|sort %}
  312.                                     <tr class="properties-row">
  313.                                         <th class="properties-label">{{ properties[key].name|trans|e }} <span style="font-weight: 400; font-size: 10px; color: darkgray;">[{{ key|e }}]</span></th>
  314.                                         <td class="properties-value scsw-pd-property-value">{{ properties[key].value|trans|e }}</td>
  315.                                     </tr>
  316.                                 {% endfor %}
  317.                             {% endif %}
  318.                         {% endblock %}
  319.                     </tbody>
  320.                 </table>
  321.             {% endblock %}
  322.         </div>
  323.     </div>
  324. {% endblock %}