src/CoreBundle/Resources/views/Areas/TeaserShopProduct/view.html.twig line 1

Open in your IDE?
  1. {% set spacingSelect %}
  2.     {{ pimcore_checkbox("checkSpacing", {
  3.         "reload": true
  4.     }) }}
  5. {% endset %}
  6. {% set noSpacingTop = '' %}
  7. {% set brickAnchorId = '' %}
  8. {% if pimcore_checkbox('checkSpacing').isChecked() %}
  9.     {% set noSpacingTop = 'no-offset-top' %}
  10. {% endif %}
  11. {% set UID = uniqid() %}
  12. {% if pimcore_input("brickAnchorIdInput") is not empty %}
  13.     {% set brickAnchorId = pimcore_input("brickAnchorIdInput")|lowercase %}
  14. {% endif %}
  15. {% set hasSliderSelect %}
  16.     {{ pimcore_select("hasSlider", {
  17.         "store": [
  18.         ["has-slider", "Slider"],
  19.         ["no-slider", "Listenansicht"]
  20.         ]
  21.     }) }}
  22. {% endset %}
  23. {% set colSelect %}
  24.     {{ pimcore_select("cols", {
  25.         "store": [
  26.         ["xs-12 full", "Full"],
  27.         ["xs-12 m-6 half", "Half"],
  28.         ["xs-12 m-6 l-4 one-third", "one-third"]
  29.         ]
  30.     }) }}
  31. {% endset %}
  32. {% set colsSelectResult = pimcore_select("cols").getData() %}
  33. {% set contentblock = pimcore_block('contentblock') %}
  34. {% if editmode %}
  35.     <div class="flex-col offset-bottom-single">
  36.         <div class="col xs-12 m-6 l-3">
  37.             <span class="hint">{{ 'admin.brick.hint.anchorId' |trans }}</span>
  38.             {{ pimcore_input("brickAnchorIdInput") }}
  39.         </div>
  40.         <div class="col xs-12 m-6 l-3">
  41.             <div class="select-items">
  42.                 <div class="hint">
  43.                     {{ 'admin.brick.hint.paddingTop' |trans }}
  44.                 </div>
  45.                 {{ spacingSelect }}
  46.             </div>
  47.         </div>
  48.         <div class="col xs-12 m-6 l-3">
  49.             <span class="hint">{{ 'admin.brick.hint.selectCol' |trans }}</span>
  50.             {{ colSelect }}
  51.         </div>
  52.         <div class="col xs-12 m-6 l-3">
  53.             <span class="hint">{{ ' admin.brick.hint.displayMode' |trans }}</span>
  54.             {{ hasSliderSelect }}
  55.         </div>
  56.     </div>
  57. {% endif %}
  58. {% if editmode %}
  59. <div class="admin teaser-panel-row">
  60.     {% endif %}
  61.     <div id="{{ brickAnchorId }}" class="section {{ noSpacingTop }}">
  62.         <div class="panel {% if editmode %} {% else %}{{ pimcore_select("hasSlider").getData() }} {% endif %}{% if colsSelectResult == 'xs-12 m-6 half' %}half{% elseif colsSelectResult == 'xs-12 full' %}full{% else %}one-third{% endif %}">
  63.             <div class="main-content">
  64.                 <div class="panel-container">
  65.                     <div class="panel-content">
  66.                         <div class="flex-col panel-slider">
  67.                             {% for i in pimcore_iterate_block(contentblock) %}
  68.                                 {% set productLink = pimcore_href("selectProduct").getElement() %}
  69.                                 {% if editmode %}
  70.                                     <div class="col">
  71.                                         <span class="hint">{{ 'admin.brick.hint.selectProduct'|trans }}</span>
  72.                                         {{ pimcore_href("selectProduct", {
  73.                                             "types": ["object"],
  74.                                             "subtypes": {
  75.                                                 "types": ["object"],
  76.                                             },
  77.                                             "classes": ["ProductFood", "ProductClothing", "Product"],
  78.                                             "reload": true
  79.                                         }) }}
  80.                                     </div>
  81.                                 {% endif %}
  82.                                 {% if productLink == true %}
  83.                                     {% if productLink.hasVariants() and productLink.getDefaultProduct() is not empty %}
  84.                                         {% set defaultProduct = productLink.getDefaultProduct()[0] %}
  85.                                         {% set price        = defaultProduct.getOSPrice() %}
  86.                                         {% set currency     = price.getCurrency() %}
  87.                                         {% set oldPrice     = currency.toCurrency(defaultProduct.getPriceOld()) %}
  88.                                         {% set articleNumber = defaultProduct.getArticleNumber() %}
  89.                                         {% set productName     = defaultProduct.getName() %}
  90.                                         {% set detailViewUri    = pimcore_url(
  91.                                             {
  92.                                                 "name": defaultProduct.getUrlTitle(),
  93.                                                 "articlenumber": defaultProduct.getArticleNumber()
  94.                                             },
  95.                                             "shopHandlerProductDetail"
  96.                                         ) %}
  97.                                     {% else %}
  98.                                         {% set price        = productLink.getOSPrice() %}
  99.                                         {% set currency     = price.getCurrency() %}
  100.                                         {% set oldPrice     = currency.toCurrency(productLink.getPriceOld()) %}
  101.                                         {% set articleNumber     = productLink.getArticleNumber() %}
  102.                                         {% set productName     = productLink.getName() %}
  103.                                         {% set detailViewUri    = pimcore_url(
  104.                                             {
  105.                                                 "name": productLink.getUrlTitle(),
  106.                                                 "articlenumber": productLink.getArticleNumber()
  107.                                             },
  108.                                             "shopHandlerProductDetail"
  109.                                         ) %}
  110.                                     {% endif %}
  111.                                     {% set thumbnailUrl     = productLink.getProductImage().getThumbnail({
  112.                                     "width": 420,
  113.                                     "height": 190,
  114.                                     "frame": true,
  115.                                     "positioning": "center"
  116.                                     }) %}
  117.                                     <div class="col {{ colsSelectResult }}">
  118.                                         <div class="teaser image-text product">
  119.                                             <div class="teaser-content bb-flex-col">
  120.                                                 <div class="image">
  121.                                                     <a href="{{ detailViewUri }}">
  122.                                                         <img src="{{ thumbnailUrl }}" title="{{ articleNumber }}"/>
  123.                                                     </a>
  124.                                                 </div>
  125.                                                 <div class="teaser-text-box bb-flex-1 bb-flex-col">
  126.                                                     <div class="title-box">
  127.                                                         <h4>
  128.                                                             <a href="{{ detailViewUri }}">{{ productName }}</a>
  129.                                                         </h4>
  130.                                                     </div>
  131.                                                     <div class="content-box product-price-container bb-flex-col bb-space-between-grow-1-i">
  132.                                                         {% if (oldPrice!=0) and (price!=oldPrice) %}
  133.                                                             <p class="product-price old">
  134.                                                                 &nbsp;{{ oldPrice }}&nbsp;
  135.                                                             </p>
  136.                                                         {% endif %}
  137.                                                         {# Use has-old-price only in the CSS of the individual brand! #}
  138.                                                         <div class="product-price {% if (oldPrice!=0) and (price!=oldPrice) %}has-old-price{% endif %}">{{ price }}</div>
  139.                                                         {% if productLink.isFoodProduct() %}
  140.                                                             <div class="product-price-additional">
  141.                                                                 {% if productLink.getChildren() %}
  142.                                                                     <div class="product-variation-container">
  143.                                                                         {{ 'Varianten vorhanden' |trans }}
  144.                                                                     </div>
  145.                                                                 {% else %}
  146.                                                                     {% if productLink.hasVariants() and productLink.getDefaultProduct() is not empty %}
  147.                                                                         {% set productInfo = defaultProduct %}
  148.                                                                     {% else %}
  149.                                                                         {% set productInfo = productLink %}
  150.                                                                     {% endif %}
  151.                                                                     {% set value = productInfo.getAmmount().getUnit().abbreviation | lower %}
  152.                                                                     {% if value == 'mg' or value == 'g' or value == 'kg' %}
  153.                                                                         <div>({{ productInfo.getPriceReferenceNew() |number_format(2, ',', '.') }} {{ '€' |trans }} / kg)</div>
  154.                                                                     {% endif %}
  155.                                                                     {% if value == 'ml' or value == 'l' %}
  156.                                                                         <div>({{ productInfo.getPriceReferenceNew() |number_format(2, ',', '.') }} {{ '€' |trans }} / l)</div>
  157.                                                                     {% endif %}
  158.                                                                     {% if value == 'stk' %}
  159.                                                                         <div>({{ productInfo.getPriceReferenceNew() |number_format(2, ',', '.') }} {{ '€' |trans }} / Stk)</div>
  160.                                                                     {% endif %}
  161.                                                                 {% endif %}
  162.                                                                 {% if productLink.hasVariants() and productLink.getDefaultProduct() is not empty %}
  163.                                                                     <div>{{ defaultProduct.getDeliveryCostHint() }}</div>
  164.                                                                 {% else %}
  165.                                                                     <div>{{ productInfo.getDeliveryCostHint() }}</div>
  166.                                                                 {% endif %}
  167.                                                             </div>
  168.                                                         {% endif %}
  169.                                                         {% if productLink.hasVariants() and productLink.getDefaultProduct() is not empty %}
  170.                                                             {% if defaultProduct.getDeliverability() == 'unavailable'  %}
  171.                                                                 <div class="dark">&nbsp;<br/>{{ defaultProduct.getDeliverability()|trans }}</div>
  172.                                                             {% else %}
  173.                                                                 <p class="greyed">{{ defaultProduct.getDeliverability()|trans }}</p>
  174.                                                             {% endif %}
  175.                                                         {% else %}
  176.                                                             {% if productLink.getDeliverability() == 'unavailable'  %}
  177.                                                                 <div class="dark">&nbsp;<br/>{{ productLink.getDeliverability()|trans }}</div>
  178.                                                             {% else %}
  179.                                                                 <p class="greyed">{{ productLink.getDeliverability()|trans }}</p>
  180.                                                             {% endif %}
  181.                                                         {% endif %}
  182.                                                         {% if productLink.hasVariants() %}
  183.                                                             <div>
  184.                                                                 <a class="button btn-default bb-line-height-normal" href="{{ detailViewUri }}">{{ 'Variante wählen'|trans }}</a>
  185.                                                             </div>
  186.                                                         {% elseif productLink.getDeliverability() == 'instant' %}
  187.                                                             <div class="product-action-wrapper" style="">
  188.                                                                 <form data-beer="1" method="post" class="js-submit-ajax" action="{{ pimcore_url({"action": "add"}, "shopHandlerCart") }}">
  189.                                                                     <div class="product-action-container" style="margin-top: 20px; align-items: center; justify-content: center;">
  190.                                                                         <div class="product-quantity">
  191.                                                                             <input type="number" name="quantity" style="color: #000; padding-top: 16px; padding-bottom: 16px;" min="1" value="1"/>
  192.                                                                             <input type="hidden" name="article" value="{{ productLink.getArticleNumber() }}">
  193.                                                                         </div>
  194.                                                                         <div class="product-action-button">
  195.                                                                             <button class="button btn-default bb-line-height-normal">
  196.                                                                                 {{ 'Add to Cart'|trans }}
  197.                                                                             </button>
  198.                                                                         </div>
  199.                                                                     </div>
  200.                                                                     {% for message in app.flashes('error') %}
  201.                                                                         {% if message.message %}
  202.                                                                             {% if message.id == productLink.id %}
  203.                                                                                 <div class="error-message inline">
  204.                                                                                     {{ message.message }}
  205.                                                                                 </div>
  206.                                                                             {% endif %}
  207.                                                                         {% else %}
  208.                                                                             <div class="error-message inline">
  209.                                                                                 {{ message }}
  210.                                                                             </div>
  211.                                                                         {% endif %}
  212.                                                                     {% endfor %}
  213.                                                                     <div data-product-id="{{ productLink.id }}" class="error-messages-container error-message" style="display: none;"></div>
  214.                                                                 </form>
  215.                                                                 {% if productLink.getPriceOld() and minimumPrice30DaysAllCountries[productLink.getId()]['DE'] is defined and minimumPrice30DaysAllCountries[productLink.getId()]['DE'] %}
  216.                                                                     <div class="product-price-additional" style="font-size: 12px; margin: 8px 4px;">
  217.                                                                         {{ 'minPriceLast30Days' | trans }} {{ currency.toCurrency(minimumPrice30DaysAllCountries[productLink.getId()]['DE']) }}
  218.                                                                     </div>
  219.                                                                 {% endif %}
  220.                                                             </div>
  221.                                                         {% else %}
  222.                                                             <div class="product-action-wrapper">
  223.                                                                 {% if productStockInformCustomerData[productLink.getId()] is defined %}
  224.                                                                     {% include 'Partials/productStockInformCustomer.html.twig' with {'backUrl': uri, 'user': user, 'product': productLink, 'productStockInformCustomerData': productStockInformCustomerData[productLink.getId()], 'labelBlack': true} %}
  225.                                                                 {% endif %}
  226.                                                             </div>
  227.                                                         {% endif %}
  228.                                                     </div>
  229.                                                 </div>
  230.                                             </div>
  231.                                         </div>
  232.                                     </div>
  233.                                 {% endif %}
  234.                             {% endfor %}
  235.                         </div>
  236.                     </div>
  237.                 </div>
  238.             </div>
  239.         </div>
  240.     </div>
  241.     {% if editmode %}
  242. </div>
  243. {% endif %}