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

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/product-detail/description.html.twig' %}
  2. {% block page_product_detail_description_title %}
  3.     <h2 class="product-detail-description-title text-uppercase">
  4.         {% if page.product.manufacturer %}
  5.             {{ page.product.manufacturer.translated.name}}
  6.         {% endif %}
  7.         {{ page.product.translated.name }}
  8.         {%- if page.product.options is defined -%}
  9.             {% set optionStrings = [] %} {% set seperatorBetweenOptions = ' ' %}
  10.             {%- for option in page.product.options -%}
  11.                 {%- set singleOption = [option.name] -%}
  12.                 {%- set optionStrings = optionStrings|merge(singleOption) -%}
  13.             {%- endfor -%} {{- optionStrings|join(seperatorBetweenOptions) -}}
  14.         {%- endif -%}
  15.     </h2>
  16. {% endblock %}
  17. {% block page_product_detail_description_content_text %}
  18.     {% set image_path="/bundles/traumplugin/img/quality_seal/" %}
  19.     {% set customFields =  page.product.translated.customFields %}
  20.     {% set quality_seals = customFields.custom_traum_default_quality_seal %}
  21.     {% set pdfMediaIds = [] %}
  22.     {% set pdfLabels = [] %}
  23.     {{ parent() }}
  24. {#    Performance Issue#}
  25.     {% if customFields.custom_traum_default_pdf_file %}
  26.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file %}
  27.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  28.         {% if customFields.custom_traum_default_pdf_file_name %}
  29.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name }) %}
  30.         {% endif %}
  31.         {#  Show Intro-Text, Snippet must be added manualy through backend #}
  32.         <hr />
  33.         {{ 'custom_traum_default_pdf_file_hint'|trans|raw  }}
  34.     {% endif %}
  35.     {% if customFields.custom_traum_default_pdf_file1 %}
  36.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file1 %}
  37.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  38.         {% if customFields.custom_traum_default_pdf_file_name1 %}
  39.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name1 }) %}
  40.         {% endif %}
  41.     {% endif %}
  42.     {% if customFields.custom_traum_default_pdf_file2 %}
  43.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file2 %}
  44.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  45.         {% if customFields.custom_traum_default_pdf_file_name2 %}
  46.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name2 }) %}
  47.         {% endif %}
  48.     {% endif %}
  49.     {% if customFields.custom_traum_default_pdf_file3 %}
  50.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file3 %}
  51.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  52.         {% if customFields.custom_traum_default_pdf_file_name3 %}
  53.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name3 }) %}
  54.         {% endif %}
  55.     {% endif %}
  56.     {% if customFields.custom_traum_default_pdf_file4 %}
  57.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file4 %}
  58.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  59.         {% if customFields.custom_traum_default_pdf_file_name4 %}
  60.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name4 }) %}
  61.         {% endif %}
  62.     {% endif %}
  63.     {% if customFields.custom_traum_default_pdf_file5 %}
  64.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file5 %}
  65.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  66.         {% if customFields.custom_traum_default_pdf_file_name5 %}
  67.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name5 }) %}
  68.         {% endif %}
  69.     {% endif %}
  70.     {% if customFields.custom_traum_default_pdf_file6 %}
  71.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file6 %}
  72.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  73.         {% if customFields.custom_traum_default_pdf_file_name6 %}
  74.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name6 }) %}
  75.         {% endif %}
  76.     {% endif %}
  77.     {% if customFields.custom_traum_default_pdf_file7 %}
  78.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file7 %}
  79.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  80.         {% if customFields.custom_traum_default_pdf_file_name7 %}
  81.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name7 }) %}
  82.         {% endif %}
  83.     {% endif %}
  84.     {% if customFields.custom_traum_default_pdf_file8 %}
  85.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file8 %}
  86.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  87.         {% if customFields.custom_traum_default_pdf_file_name8 %}
  88.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name8 }) %}
  89.         {% endif %}
  90.     {% endif %}
  91.     {% if customFields.custom_traum_default_pdf_file9 %}
  92.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file9 %}
  93.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  94.         {% if customFields.custom_traum_default_pdf_file_name9 %}
  95.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name9 }) %}
  96.         {% endif %}
  97.     {% endif %}
  98.     {% if customFields.custom_traum_default_pdf_file10 %}
  99.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file10 %}
  100.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  101.         {% if customFields.custom_traum_default_pdf_file_name10 %}
  102.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name10 }) %}
  103.         {% endif %}
  104.     {% endif %}
  105.     {% if customFields.custom_traum_default_pdf_file11 %}
  106.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file11 %}
  107.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  108.         {% if customFields.custom_traum_default_pdf_file_name11 %}
  109.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name11 }) %}
  110.         {% endif %}
  111.     {% endif %}
  112.     {% if customFields.custom_traum_default_pdf_file12 %}
  113.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file12 %}
  114.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  115.         {% if customFields.custom_traum_default_pdf_file_name12 %}
  116.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name12 }) %}
  117.         {% endif %}
  118.     {% endif %}
  119.     {% if customFields.custom_traum_default_pdf_file13 %}
  120.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file13 %}
  121.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  122.         {% if customFields.custom_traum_default_pdf_file_name13 %}
  123.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name13 }) %}
  124.         {% endif %}
  125.     {% endif %}
  126.     {% if customFields.custom_traum_default_pdf_file14 %}
  127.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file14 %}
  128.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  129.         {% if customFields.custom_traum_default_pdf_file_name14 %}
  130.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name14 }) %}
  131.         {% endif %}
  132.     {% endif %}
  133.     {% if customFields.custom_traum_default_pdf_file15 %}
  134.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file15 %}
  135.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  136.         {% if customFields.custom_traum_default_pdf_file_name15 %}
  137.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name15 }) %}
  138.         {% endif %}
  139.     {% endif %}
  140.     {% if customFields.custom_traum_default_pdf_file16 %}
  141.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file16 %}
  142.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  143.         {% if customFields.custom_traum_default_pdf_file_name16 %}
  144.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name16 }) %}
  145.         {% endif %}
  146.     {% endif %}
  147.     {% if customFields.custom_traum_default_pdf_file17 %}
  148.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file17 %}
  149.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  150.         {% if customFields.custom_traum_default_pdf_file_name17 %}
  151.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name17 }) %}
  152.         {% endif %}
  153.     {% endif %}
  154.     {% if customFields.custom_traum_default_pdf_file18 %}
  155.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file18 %}
  156.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  157.         {% if customFields.custom_traum_default_pdf_file_name18 %}
  158.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name18 }) %}
  159.         {% endif %}
  160.     {% endif %}
  161.     {% if customFields.custom_traum_default_pdf_file19 %}
  162.         {% set pdfMediaId = customFields.custom_traum_default_pdf_file19 %}
  163.         {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}
  164.         {% if customFields.custom_traum_default_pdf_file_name19 %}
  165.             {% set pdfLabels = pdfLabels|merge({ (pdfMediaId):  customFields.custom_traum_default_pdf_file_name19 }) %}
  166.         {% endif %}
  167.     {% endif %}
  168. {#    {% for i in 1..19 %}#}
  169. {#        {i}, Loop does not work!
  170. {#        {% if customFields.custom_traum_default_pdf_file~{{ i }} %}#}
  171. {#            {% set pdfMediaId = customFields.custom_traum_default_pdf_file~{{ i }} %}#}
  172. {#            {% set pdfMediaIds = pdfMediaIds|merge([pdfMediaId]) %}#}
  173. {#        {% endif %}#}
  174. {#    {% endfor %}#}
  175. {#    {{ dump(pdfLabels) }}#}
  176.     {% if customFields.custom_traum_default_pdf_file %}
  177.         {% set mediaCollection = searchMedia(pdfMediaIds, context.context) %}
  178.         {% if mediaCollection %}
  179.             {% for pdfEntity in mediaCollection %}
  180.                 <p><a class="btn btn-secondary btn-sm" rel="noopener" href="{{pdfEntity.url}}" target="_blank">
  181.                         {% if pdfLabels[pdfEntity.id] %}
  182.                             {{ pdfLabels[pdfEntity.id] }}
  183.                         {% else %}
  184.                             {{ pdfEntity.fileName }}
  185.                         {% endif %}
  186.                     </a></p>
  187.             {% endfor %}
  188.         {% endif %}
  189.     {% endif %}
  190.     {% if customFields.custom_traum_default_show_sofa_hint %}
  191. {#        Show sofa hint #}
  192.         {{ 'customFields.custom_traum_default_show_sofa_hint'|trans|raw }}
  193.     {% endif %}
  194. <hr/>
  195.     {% if customFields.custom_traum_default_tab_title %}
  196.         <div class="h3"> {{ customFields.custom_traum_default_tab_title  }}</div>
  197.     {% endif %}
  198.     {% if customFields.custom_traum_default_tab_content %}
  199.         <div class="product-detail-description-text">
  200.         {{ customFields.custom_traum_default_tab_content |raw  }}
  201.         </div>
  202.     {% endif %}
  203.     {% if quality_seals|length > 0 %}
  204.         <div class="panel panel-default">
  205.             <div class="panel-heading">
  206.                 <h4 class="panel-title text-uppercase">
  207. {#                    Snippet must be added manualy through backend#}
  208.                     {{ "traum_quality_seal" |trans }}
  209.                 </h4>
  210.             </div>
  211.             <div class="panel-body">
  212.                 {% for quality_seal in quality_seals %}
  213.                     <img src="{{ image_path ~ quality_seal }}.jpg" alt="logo_{{ quality_seal }}"  />
  214.                 {% endfor %}
  215.             </div>
  216.         </div>
  217.     {% endif %}
  218. {% endblock %}
  219. {% block page_product_detail_description_content_properties %} {% endblock %}