templates/uniqskills/catalogue/landing_new/landing_partials/courseTitle.html.twig line 1

Open in your IDE?
  1. {% set image = vich_uploader_asset(module.backgroundImage, 'file') %}
  2. {% set imageMobile = vich_uploader_asset(module.backgroundImageMobile, 'file') %}
  3. {# TIMER - date from coupon (dateTo) set in subcription [PAYMENT MODULE] #}
  4. {% set paymentModule = findModuleByType(landing.modules, 'payment') %}
  5. {% set promotionBarModule = findModuleByType(landing.modules, 'promotionBar') %}
  6. {% set productVariantsToDisplay = [] %}
  7. {% set couponParam = app.request.query.get('apicoupon') %}
  8. {% set discountCode = null %}
  9. {# Select product variants from paymentModule #}
  10. {% for landingProductVariant in paymentModule.subscriptions %}
  11.     {% for productVariant in productVariants %}
  12.         {% if productVariant.id == landingProductVariant.subscription %}
  13.             {% set productVariantsToDisplay = productVariantsToDisplay|merge([{
  14.                 'productVariant': productVariant,
  15.                 'landingProductVariant': landingProductVariant
  16.             }]) %}
  17.         {% endif %}
  18.     {% endfor %}
  19. {% endfor %}
  20. {# Find discount code if applicable #}
  21. {% for productVariantToDisplay in productVariantsToDisplay %}
  22.     {% if productVariantToDisplay['landingProductVariant'] is not empty %}
  23.         {% for subscriptionCoupon in productVariantToDisplay['productVariant'].coupon %}
  24.             {% if couponParam is not empty %}
  25.                 {% if subscriptionCoupon.code == couponParam and discountCode is empty %}
  26.                     {% set discountCode = subscriptionCoupon %}
  27.                 {% endif %}
  28.             {% elseif productVariantToDisplay['landingProductVariant'].discountCode is not empty %}
  29.                 {% if subscriptionCoupon.id == productVariantToDisplay['landingProductVariant'].discountCode and discountCode is empty %}
  30.                     {% set discountCode = subscriptionCoupon %}
  31.                 {% endif %}
  32.             {% endif %}
  33.         {% endfor %}
  34.     {% endif %}
  35. {% endfor %}
  36. {% set promotionIsActive = discountCode is not null and discountCode.dateTo|date("U") > "now"|date("U") and discountCode.isActive %}
  37. <section class="rowHeader"
  38.          style="{{ module.backgroundImageColorRadio == 'color' ? 'background: ' ~ module.background ~ '; ' : ' background: url(' ~ vich_uploader_asset(module.backgroundImage, 'file') ~ ') ' }} no-repeat center top; background-size: 100%;"
  39.          data-image="{{ module.backgroundImageColorRadio }}"
  40.          data-background="{{ image ? image | imagine_filter('img_1600_width') : image }}"
  41.          data-background-mobile="{{ imageMobile ? imageMobile | imagine_filter('img_700_width') : imageMobile }}"
  42. >
  43.     <div class="rowHeader_overlay" {% if courseTitleRGBA %} style="background: {{ courseTitleRGBA }}" {% endif %} >
  44.         {% if (module.courseParticipantsActive is defined and module.courseParticipantsActive) or module.courseParticipantsActive is not defined %}
  45.             <div class="container-fluid d-none d-md-block">
  46.                 <div class="row">
  47.                     <div class="col-12">
  48.                         <div class="rowHeader__yellowRow">
  49.                             <div class="rowHeader__yellowRow__text">
  50.                                 {% if module.courseParticipantsCount is defined and module.courseParticipantsCount > 9 %}
  51.                                     <strong>{{ module.courseParticipantsCount }} </strong>
  52.                                 {% else %}
  53.                                     <strong>{{ countOrders }} </strong>
  54.                                 {% endif %}
  55.                                 <strong>{{ 'uniqskills.landing.nl.peopleAlreadySigned'|trans }}</strong><br/>
  56.                                 {{ 'uniqskills.landing.nl.joinThemToday'|trans }}
  57.                             </div>
  58.                         </div>
  59.                     </div>
  60.                 </div>
  61.             </div>
  62.         {% endif %}
  63.         <div class="container rowHeader__textRow d-none d-md-block">
  64.             <div class="row">
  65.                 <div class="col"></div>
  66.                 <div class="col-12 col-md-8 text-center ">
  67.                     <h1>{{ course.name }}</h1>
  68.                 </div>
  69.                 <div class="col"></div>
  70.             </div>
  71.             <div class="row">
  72.                 {% if module.promoVideo is defined
  73.                     and validateUrl(module.promoVideo) != false
  74.                 %}
  75.                     <div class="col-12 col-md-3">
  76.                         <div class="embed-container border-0">
  77.                             <iframe allowfullscreen
  78.                                     frameborder="0"
  79.                                     src="{{ module.promoVideo }}">
  80.                             </iframe>
  81.                         </div>
  82.                     </div>
  83.                 {% else %}
  84.                     <div class="col-3 d-none d-sm-block">
  85.                         {% if module.courseBadgeRadio is defined and module.courseBadgeRadio != 'nobadge' %}
  86.                             <img style="max-width: 56px;"
  87.                                  src="{{ asset('/uniqskills/new_landing/images/' ~ module.courseBadgeRadio ~ '.png') }}"> {{ ('uniqskills.landing.nl.' ~ module.courseBadgeRadio)|trans }}
  88.                         {% endif %}
  89.                     </div>
  90.                 {% endif %}
  91.                 <div class="col-12 col-md-6 text-center">
  92.                     {% if showTimer %}
  93.                         <div class="rowHeader__textRow__timerTitle">{{ 'uniqskills.landing.nl.startTimer'|trans }}</div>
  94.                         <div id="timer" data-timer-state="{{ showTimer.format('Y-m-d H:i:s') }}"
  95.                              class="row rowHeader__textRow__timer">
  96.                             <div id="days" data-label="{{ 'uniqskills.landing.nl.timerDays'|trans }}" class="col"></div>
  97.                             <div id="hours" data-label="{{ 'uniqskills.landing.nl.timerHours'|trans }}"
  98.                                  class="col"></div>
  99.                             <div id="minutes" data-label="{{ 'uniqskills.landing.nl.timerMinutes'|trans }}"
  100.                                  class="col"></div>
  101.                             <div id="seconds" data-label="{{ 'uniqskills.landing.nl.timerSeconds'|trans }}"
  102.                                  class="col"></div>
  103.                         </div>
  104.                     {% elseif promotionIsActive and not (promotionBarModule is not empty and promotionBarModule.hideTimerIfPromotionActive is defined and promotionBarModule.hideTimerIfPromotionActive == true) %}
  105.                         <div class="rowHeader__textRow__timerTitle">{{ 'uniqskills.landing.nl.discountUntil'|trans }}</div>
  106.                         <div id="timer" data-timer-state="{{ discountCode.dateTo.format('Y-m-d H:i:s') }}"
  107.                              class="row rowHeader__textRow__timer">
  108.                             <div id="days" data-label="{{ 'uniqskills.landing.nl.timerDays'|trans }}" class="col"></div>
  109.                             <div id="hours" data-label="{{ 'uniqskills.landing.nl.timerHours'|trans }}" class="col"></div>
  110.                             <div id="minutes" data-label="{{ 'uniqskills.landing.nl.timerMinutes'|trans }}" class="col"></div>
  111.                             <div id="seconds" data-label="{{ 'uniqskills.landing.nl.timerSeconds'|trans }}" class="col"></div>
  112.                         </div>
  113.                     {% endif %}
  114.                     <div class="rowHeader__textRow__description">
  115.                         {{ course.shortBody }}
  116.                     </div>
  117.                     {% if cooperatorsOption['center'] == true %}
  118.                         {% if cooperators %}
  119.                             <div class="d-none d-sm-block" style="margin-top:20px;{% if cooperatorsOption['color'] != null %} color: {{ cooperatorsOption['color'] }};{% endif %}">
  120.                                 {% if cooperatorsOption['title'] != null %}{{ cooperatorsOption['title'] }}{% else %}{{ 'uniqskills.landing.nl.cooperation'|trans }}{% endif %}
  121.                             </div>
  122.                             {% for cooperator in cooperators %}
  123.                                 <a href="{{ cooperator['url'] }}" target="_blank"><img class="d-none d-sm-block cooperator-image" style="max-width: 100%;" src="{{ vich_uploader_asset(cooperator['image'], 'file') | imagine_filter('img_200_width') }}"></a>
  124.                             {% endfor %}
  125.                         {% endif %}
  126.                     {% endif %}
  127.                 </div>
  128.                 <div class="col-12 col-md-3 text-center">
  129.                     <div class="d-block d-sm-none mt-3 rowHeader__textRow__bagdeMobile text-left"
  130.                          style="font-size: 0.8rem;">
  131.                         <div class="row">
  132.                             <div class="col-12">
  133.                                 {% if module.courseBadgeRadio is defined and module.courseBadgeRadio != 'nobadge' %}
  134.                                     <img style="max-width: 12%; margin-right: 5px;"
  135.                                          src="{{ asset('/uniqskills/new_landing/images/' ~ module.courseBadgeRadio ~ '.png') }}"> {{ ('uniqskills.landing.nl' ~ module.courseBadgeRadio)|trans }}
  136.                                 {% endif %}
  137.                             </div>
  138.                         </div>
  139.                         <div class="row mt-3">
  140.                             <div class="col-7">
  141.                                 {% if (module.courseParticipantsActive is defined and module.courseParticipantsActive) or module.courseParticipantsActive is not defined %}
  142.                                     <div class="rowHeader__yellowRow__text__normal">
  143.                                     <span>
  144.                                         {% if module.courseParticipantsCount is defined and module.courseParticipantsCount > 9 %}
  145.                                             <strong>{{ module.courseParticipantsCount }} </strong>
  146.                                         {% else %}
  147.                                             <strong>{{ countOrders }} </strong>
  148.                                         {% endif %}
  149.                                         {{ 'uniqskills.landing.nl.peopleAlreadySigned'|trans }}
  150.                                     </span><br/>
  151.                                         {{ 'uniqskills.landing.nl.joinThemToday'|trans }}
  152.                                     </div>
  153.                                 {% endif %}
  154.                             </div>
  155.                             <div class="col-5">
  156.                                 {% for cooperator in cooperators %}
  157.                                     <img style="max-width: 100%; display: block;"
  158.                                          src="{{ vich_uploader_asset(cooperator['image'], 'file') | imagine_filter('img_200_width') }}">
  159.                                 {% endfor %}
  160.                             </div>
  161.                         </div>
  162.                     </div>
  163.                     {% if cooperatorsOption['center'] != true %}
  164.                         {% if cooperators %}
  165.                             <div class="d-none d-sm-block" {% if cooperatorsOption['color'] != null %}style="color: {{ cooperatorsOption['color'] }};"{% endif %}>
  166.                                 {% if cooperatorsOption['title'] != null %}{{ cooperatorsOption['title'] }}{% else %}{{ 'uniqskills.landing.nl.cooperation'|trans }}{% endif %}
  167.                             </div>
  168.                             {% for cooperator in cooperators %}
  169.                                 <a href="{{ cooperator['url'] }}" target="_blank"><img class="d-none d-sm-block cooperator-image" style="max-width: 100%;"
  170.                                    src="{{ vich_uploader_asset(cooperator['image'], 'file') | imagine_filter('img_200_width') }}"></a>
  171.                             {% endfor %}
  172.                         {% endif %}
  173.                     {% endif %}
  174.                 </div>
  175.             </div>
  176.         </div>
  177.         {# Header for mobile #}
  178.         <div class="rowHeader__textRow rowHeader__textRow--mobile d-block d-md-none">
  179.             <div class="rowHeader-mobile-image"
  180.                  style="{{ module.backgroundImageColorRadio == 'color' ? 'background: ' ~ module.background ~ '; ' : ' background: url(' ~ vich_uploader_asset(module.backgroundImage, 'file') ~ ') ' }} no-repeat center top; background-size: 100%;"
  181.                  data-image="{{ module.backgroundImageColorRadio }}"
  182.                  data-background="{{ image ? image | imagine_filter('img_1600_width') : image }}"
  183.                  data-background-mobile="{{ imageMobile ? imageMobile | imagine_filter('img_700_width') : imageMobile }}">
  184.                 {% if (module.courseParticipantsActive is defined and module.courseParticipantsActive) or module.courseParticipantsActive is not defined %}
  185.                     <div class="rowHeader__yellowRow__text__normal">
  186.                          <span class="rowHeader__yellowRow__label">
  187.                              <span class="rowHeader__yellowRow__label-inner">
  188.                                 {% if module.courseParticipantsCount is defined and module.courseParticipantsCount > 9 %}
  189.                                     <strong>{{ module.courseParticipantsCount }} </strong>
  190.                                 {% else %}
  191.                                     <strong>{{ countOrders }} </strong>
  192.                                 {% endif %}
  193.                                 <span class="rowHeader__yellowRow__text__normal-text">{{ 'uniqskills.landing.nl.peopleAlreadySigned'|trans }}</span><br>
  194.                                 <span class="rowHeader__yellowRow__text__normal-text rowHeader__yellowRow__text__normal-text--no-padding">{{ 'uniqskills.landing.nl.joinThemToday'|trans }}</span>
  195.                              </span>
  196.                         </span>
  197.                     </div>
  198.                 {% endif %}
  199.                 <div class="container">
  200.                     <div class="row">
  201.                         <div class="col"></div>
  202.                         <div class="col-12 col-md-8 text-center ">
  203.                             <h2>{{ course.name }}</h2>
  204.                         </div>
  205.                         <div class="col"></div>
  206.                     </div>
  207.                     <div class="row">
  208.                         <div class="col-12 col-md-6 text-center">
  209.                             {% if showTimer %}
  210.                                 <div class="rowHeader__textRow__timerTitle">{{ 'uniqskills.landing.nl.startTimer'|trans }}</div>
  211.                                 <div id="timer2" data-timer-state="{{ showTimer.format('Y-m-d H:i:s') }}"
  212.                                      class="row rowHeader__textRow__timer">
  213.                                     {#<div class="col-2 col-md-3"></div>#}
  214.                                     <div id="days2" data-label="{{ 'uniqskills.landing.nl.timerDays'|trans }}"
  215.                                          class="col"></div>
  216.                                     <div id="hours2" data-label="{{ 'uniqskills.landing.nl.timerHours'|trans }}"
  217.                                          class="col"></div>
  218.                                     <div id="minutes2" data-label="{{ 'uniqskills.landing.nl.timerMinutes'|trans }}"
  219.                                          class="col"></div>
  220.                                     <div id="seconds2" data-label="{{ 'uniqskills.landing.nl.timerSeconds'|trans }}"
  221.                                          class="col"></div>
  222.                                     {#<div class="col-2 col-md-3"></div>#}
  223.                                 </div>
  224.                                 {#{% else %}#}
  225.                                 {#<div class="rowHeader__mobile-info">#}
  226.                                 {#<p>{{ 'form.registration.signUpNow'|trans }}</p>#}
  227.                                 {#<a href="#rowSignUp__anchor" data-link="rowSignUp__anchor" class="rowHeader__mobile-button menu-link-scroll">{{ 'uniqskills.landing.signInNow'|trans }}</a>#}
  228.                                 {#</div>#}
  229.                             {% elseif promotionIsActive and not (promotionBarModule is not empty and promotionBarModule.hideTimerIfPromotionActive is defined and promotionBarModule.hideTimerIfPromotionActive == true) %}
  230.                                 <div class="rowHeader__textRow__timerTitle">{{ 'uniqskills.landing.nl.discountUntil'|trans }}</div>
  231.                                 <div id="timer2" data-timer-state="{{ discountCode.dateTo.format('Y-m-d H:i:s') }}" class="row rowHeader__textRow__timer">
  232.                                     <div id="days2" data-label="{{ 'uniqskills.landing.nl.timerDays'|trans }}" class="col"></div>
  233.                                     <div id="hours2" data-label="{{ 'uniqskills.landing.nl.timerHours'|trans }}" class="col"></div>
  234.                                     <div id="minutes2" data-label="{{ 'uniqskills.landing.nl.timerMinutes'|trans }}" class="col"></div>
  235.                                     <div id="seconds2" data-label="{{ 'uniqskills.landing.nl.timerSeconds'|trans }}" class="col"></div>
  236.                                 </div>
  237.                             {% endif %}
  238.                         </div>
  239.                         {% if module.promoVideo is defined
  240.                             and validateUrl(module.promoVideo) != false
  241.                         %}
  242.                         <div class="col-12 col-md-6 text-center mt-1">
  243.                             <iframe allowfullscreen
  244.                                     frameborder="0"
  245.                                     src="{{ module.promoVideo }}">
  246.                             </iframe>
  247.                         </div>
  248.                         {% endif %}
  249.                     </div>
  250.                 </div>
  251.                 <div class="rowHeader-mobile-overlay" {% if courseTitleRGBA %} style="background: {{ courseTitleRGBA }}" {% endif %}></div>
  252.             </div>
  253.             <div class="container">
  254.                 <div class="row">
  255.                     <div class="col-12 col-md-6 text-center">
  256.                         <div class="rowHeader__textRow__description">
  257.                             {{ course.shortBody }}
  258.                         </div>
  259.                     </div>
  260.                     <div class="col-12 col-md-3 text-center">
  261.                         <div class="d-block d-md-none mt-3 rowHeader__textRow__bagdeMobile text-left"
  262.                              style="font-size: 0.8rem;">
  263.                             <div class="row">
  264.                                 <div class="col-12">
  265.                                     {% if module.courseBadgeRadio is defined and module.courseBadgeRadio != 'nobadge' %}
  266.                                         <div class="mobile-badge-wrapper">
  267.                                             <img style="max-width: 45px !important; margin-right: 5px;" src="{{ asset('/uniqskills/new_landing/images/' ~ module.courseBadgeRadio ~ '.png') }}">
  268.                                             {{ ('uniqskills.landing.nl.' ~ module.courseBadgeRadio)|trans }}
  269.                                         </div>
  270.                                     {% endif %}
  271.                                 </div>
  272.                                 <div class="col-12 cooperators-mobile-title">
  273.                                     <span class="text">
  274.                                         {% if cooperatorsOption['title'] != null %}{{ cooperatorsOption['title'] }}{% else %}{{ 'uniqskills.landing.nl.cooperation'|trans }}{% endif %}
  275.                                     </span>
  276.                                 </div>
  277.                             </div>
  278.                             <div class="row align-items-center cooperators-mobile-list__wrapper">
  279.                                 <div class="col-12 cooperators-mobile-list">
  280.                                     {% for cooperator in cooperators %}
  281.                                         <a href="{{ cooperator['url'] }}" target="_blank" class="cooperators-mobile-list__item {% if loop.length == 1 %}cooperators-mobile-list__item--center{% endif %}">
  282.                                             <img src="{{ vich_uploader_asset(cooperator['image'], 'file') | imagine_filter('img_200_width') }}"></a>
  283.                                     {% endfor %}
  284.                                 </div>
  285.                             </div>
  286.                         </div>
  287.                     </div>
  288.                 </div>
  289.             </div>
  290.         </div>
  291.         {# End header for mobile #}
  292.         {% if freeLessonsInCourse is not empty %}
  293.             <div class="rowHeader__freeLesson">
  294.                 <div class="titleFreeLessonBox">
  295.                     <div class="title">
  296.                         <span style="font-size:18px; font-weight: bold;">{{ 'uniqskills.landing.freeLessons'|trans }}</span><br>
  297.                         <span style="font-size:14px;">{{ 'uniqskills.landing.checkFreeSample'|trans }}</span>
  298.                         <div class="iconArrowFreeLession">
  299.                             <img src="{{ asset('/icons/arrow-up.svg') }}">
  300.                         </div>
  301.                     </div>
  302.                 </div>
  303.                 <div class="freeLessonInCourse">
  304.                     {% for freeLessonInCourse in freeLessonsInCourse %}
  305.                         {% if freeLessonInCourse.isVimeo == true or freeLessonInCourse.isBbVideo == true %}
  306.                             <div class="boxLesson showFreeLessonVimeo" data-vimeoUrl="{{ freeLessonInCourse.link }}">
  307.                                 <img src="{{ asset('/icons/play.svg') }}">{{ freeLessonInCourse.title }}<br>
  308.                             </div>
  309.                         {% else %}
  310.                             <div class="boxLesson">
  311.                                 <a target="_blank" href="{{ freeLessonInCourse.link }}"><img style="width: 15px;" src="{{ asset('/icons/document.svg') }}">{{ freeLessonInCourse.title }}</a>
  312.                             </div>
  313.                         {% endif %}
  314.                     {% endfor %}
  315.                 </div>
  316.             </div>
  317.             <div class="modal fade" id="freeVideoModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  318.                 <div class="modal-dialog" role="document">
  319.                     <div class="modal-content">
  320.                         <div class="modal-header">
  321.                             <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  322.                                 <span aria-hidden="true">&times;</span>
  323.                             </button>
  324.                         </div>
  325.                         <div class="modal-body">
  326.                             <iframe id="freeVideoModalIframe" src=""
  327.                                     width="640" height="460" frameborder="0" allowfullscreen
  328.                                     style="display: block; margin: 0 auto;"
  329.                             ></iframe>
  330.                         </div>
  331.                     </div>
  332.                 </div>
  333.             </div>
  334.         {% endif %}
  335.         <div class="rowHeader__textRow__linkAndPrice">
  336.             <div class="container">
  337.                 <div class="row">
  338.                     <div class="col-12 col-lg-8 rowHeader__textRow__linkAndPrice__links">
  339.                         <div class="row text-center">
  340.                             <div class="second-menu-slider">
  341.                                 {% for mod in landing.modules %}
  342.                                     {% if mod.inSecondMenu %}
  343.                                         <a
  344.                                             data-link="{{ mod.type }}-{{ mod.id }}"
  345.                                             href="#{{ mod.type }}-{{ mod.id }}"
  346.                                             class="menu-link-scroll rowHeader__textRow__linkAndPrice__links__items slide">
  347.                                             <span>
  348.                                                 {{ ('uniqskills.landing.s2m.' ~ mod.type)|trans }}
  349.                                             </span>
  350.                                             <div {% if app.request.locale == 'en' %}style="bottom: 1px;"{% endif %} class="bgs2 {{ mod.linkIconClass }}"></div>
  351.                                         </a>
  352.                                     {% endif %}
  353.                                 {% endfor %}
  354.                             </div>
  355.                         </div>
  356.                     </div>
  357.                     {% if defaultProductVariant is defined and defaultProductVariant %}
  358.                         {% set productVariantsToDisplay = [] %}
  359.                         {# display price in usd if there are no productVariants for current user country #}
  360.                         {% for landingProductVariant in subscriptionForDefaultPrice %}
  361.                             {% if defaultProductVariant.id == landingProductVariant.subscription %}
  362.                                 {% set productVariantsToDisplay = [{
  363.                                     'productVariant': defaultProductVariant,
  364.                                     'landingProductVariant': landingProductVariant
  365.                                 }] %}
  366.                             {% endif %}
  367.                         {% endfor %}
  368.                         <div class="col-4 rowHeader__textRow__linkAndPrice__priceBox price-box">
  369.                             <div class="row">
  370.                                 <div class="switch-net-gross-box">
  371.                                     <span class="switch-net-gross-box-title">Pokazuj ceny jako:</span>
  372.                                     <div class="btn-group btn-group-sm" role="group" aria-label="Switch net/gross">
  373.                                         <button type="button"
  374.                                                 class="btn btn-light {{ initialType == 'netto' ? 'active' : '' }} js-switch-netto"
  375.                                         >
  376.                                             netto
  377.                                         </button>
  378.                                         <button type="button"
  379.                                                 class="btn btn-light {{ initialType == 'brutto' ? 'active' : '' }} js-switch-brutto"
  380.                                         >
  381.                                             brutto
  382.                                         </button>
  383.                                     </div>
  384.                                 </div>
  385.                             </div>
  386.                             <div class="row">
  387.                                 <div class="offset-2 offset-md-0 col-4 col-md-12 rowHeader__textRow__linkAndPrice__priceBox__title">
  388.                                     {{ 'uniqskills.landing.price'|trans }}
  389.                                 </div>
  390.                             </div>
  391.                             <div class="row">
  392.                                 {# --- Checking for coupon code from parameter --- #}
  393.                                 {% set couponParam = app.request.query.get('apicoupon') %}
  394.                                 {# --- END OF: Checking for coupon code from parameter --- #}
  395.                                 {% for item in productVariantsToDisplay %}
  396.                                 {% set landingProductVariant = item['landingProductVariant'] %}
  397.                                 {% set productVariant = item['productVariant'] %}
  398.                                 {% set discountCode = null %}
  399.                                 {% if couponParam is not empty %}
  400.                                     {% set apiCouponEntity = getCouponEntity(couponParam) %}
  401.                                     {% if isCouponSuitable(apiCouponEntity, productVariant) %}
  402.                                         {% set discountCode = apiCouponEntity %}
  403.                                     {% endif %}
  404.                                 {% endif %}
  405.                                 {% if discountCode == null and landingProductVariant is not empty %}
  406.                                     {% for subscriptionCoupon in productVariant.coupon %}
  407.                                         {% if couponParam is not empty %}
  408.                                             {% if subscriptionCoupon.code == couponParam and discountCode is empty %}
  409.                                                 {% set discountCode = subscriptionCoupon %}
  410.                                             {% endif %}
  411.                                         {% elseif landingProductVariant.discountCode is not empty %}
  412.                                             {% if subscriptionCoupon.id == landingProductVariant.discountCode %}
  413.                                                 {% set discountCode = subscriptionCoupon %}
  414.                                             {% endif %}
  415.                                         {% endif %}
  416.                                     {% endfor %}
  417.                                 {% endif %}
  418.                                 {# --- Calculating prices --- #}
  419.                                     {% set priceData = [] %}
  420.                                     {% if landingProductVariant %}
  421.                                         {% set priceData = getVariantPriceDetails(landingProductVariant.subscription, discountCode ? discountCode.code : null) %}
  422.                                         {% if discountCode is not empty and priceData.couponActive is defined and priceData.couponActive %}
  423.                                             {% set activePriceNet = priceData.priceAfterCouponNet > 0 ? priceData.priceAfterCouponNet : priceData.priceNet %}
  424.                                             {% set activePriceGross = priceData.priceAfterCouponGross > 0 ? priceData.priceAfterCouponGross : priceData.priceGross %}
  425.                                             {% set
  426.                                                 hasDiscount = discountCode is not empty
  427.                                                 and
  428.                                                 (activePriceNet|replace({',': '.'}) * 1) < (priceData.priceNet|replace({',': '.'}) * 1)
  429.                                             %}
  430.                                         {% else %}
  431.                                             {% set hasDiscount = false %}
  432.                                             {% set activePriceNet = priceData.priceNet %}
  433.                                             {% set activePriceGross = priceData.priceGross %}
  434.                                         {% endif %}
  435.                                     {% endif %}
  436.                                 {# --- END OF: Calculating prices --- #}
  437.                                 {% set installmentAmount = '' %}
  438.                                 {% if productVariant is not empty and productVariant.installmentAmount > 1 and productVariant.paymentType.slug == 'partial-payment' %}
  439.                                     {% set installmentAmount = productVariant.installmentAmount ~ 'x' %}
  440.                                 {% endif %}
  441.                                 {% set isOmnibus = hasDiscount and app.request.locale == 'pl' and priceData.omnibusNet is defined and priceData.omnibusGross is defined %}
  442.                                 <div class="{% if isOmnibus == false %}col-6{% else %}offset-2 offset-md-0 col-4{% endif %} rowSignUp__modal__price__oldPrice-container">
  443.                                     {% if discountCode is not null and priceData is not empty and hasDiscount %}
  444.                                         <div class="rowSignUp__modal__price__oldPrice">
  445.                                             {{ installmentAmount }}
  446.                                             <div class="js-old-netto" style="display: {{ initialType == 'netto' ? 'block' : 'none' }};">
  447.                                                 {{ priceData.priceNet }} PLN
  448.                                             </div>
  449.                                             <div class="js-old-brutto" style="display: {{ initialType == 'brutto' ? 'block' : 'none' }};">
  450.                                                 {{ priceData.priceGross }} PLN
  451.                                             </div>
  452.                                         </div>
  453.                                         <div class="rowHeader__textRow__linkAndPrice__priceBox__currentPrice">
  454.                                             {{ installmentAmount }}
  455.                                             <div class="js-active-netto" style="display: {{ initialType == 'netto' ? 'block' : 'none' }};">
  456.                                                 {{ activePriceNet }} PLN
  457.                                             </div>
  458.                                             <div class="js-active-brutto" style="display: {{ initialType == 'brutto' ? 'block' : 'none' }};">
  459.                                                 {{ activePriceGross }} PLN
  460.                                             </div>
  461.                                         </div>
  462.                                     {% else %}
  463.                                         <div class="rowHeader__textRow__linkAndPrice__priceBox__currentPrice">
  464.                                             {{ installmentAmount }}
  465.                                             {% if priceData is not empty %}
  466.                                                 <div class="js-active-netto" style="display: {{ initialType == 'netto' ? 'block' : 'none' }};">
  467.                                                     {{ activePriceNet }} PLN
  468.                                                 </div>
  469.                                                 <div class="js-active-brutto" style="display: {{ initialType == 'brutto' ? 'block' : 'none' }};">
  470.                                                     {{ activePriceGross }} PLN
  471.                                                 </div>
  472.                                             {% else %}
  473.                                                 {% if app.request.locale == "pl" %}
  474.                                                     {{ course.defaultPrice }} PLN
  475.                                                 {% elseif app.request.locale == "en-us" or app.request.locale == 'de' %}
  476.                                                     {{ course.defaultPrice }} EUR
  477.                                                 {% else %}
  478.                                                     {{ course.defaultPrice }} USD
  479.                                                 {% endif %}
  480.                                             {% endif %}
  481.                                         </div>
  482.                                     {% endif %}
  483.                                     {% if isOmnibus != false %}
  484.                                         <div class="col-12 d-block d-md-none omnibus-widget">
  485.                                             <div class="js-active-netto" style="display: {{ initialType == 'netto' ? 'block' : 'none' }};">
  486.                                                 Najniższa cena z 30 dni przed promocją: <span class="kc-price">{{ priceData.omnibusNet }} zł</span>
  487.                                             </div>
  488.                                             <div class="js-active-brutto" style="display: {{ initialType == 'brutto' ? 'block' : 'none' }};">
  489.                                                 Najniższa cena z 30 dni przed promocją: <span class="kc-price">{{ priceData.omnibusGross }} zł</span>
  490.                                             </div>
  491.                                         </div>
  492.                                     {% endif %}
  493.                                 </div>
  494.                                 {% if isOmnibus != false %}
  495.                                     <div class="col-4 d-none d-md-block omnibus-widget">
  496.                                         <div class="js-active-netto" style="display: {{ initialType == 'netto' ? 'block' : 'none' }};">
  497.                                             Najniższa cena z 30 dni przed promocją: <span class="kc-price">{{ priceData.omnibusNet }} zł</span>
  498.                                         </div>
  499.                                         <div class="js-active-brutto" style="display: {{ initialType == 'brutto' ? 'block' : 'none' }};">
  500.                                             Najniższa cena z 30 dni przed promocją: <span class="kc-price">{{ priceData.omnibusGross }} zł</span>
  501.                                         </div>
  502.                                     </div>
  503.                                 {% endif %}
  504.                                 <div class="{% if isOmnibus == false %}col-6{% else %}col-4{% endif %} rowHeader__textRow__linkAndPrice__priceBox__btnSignUp-container">
  505.                                     {% if productVariant is not empty %}
  506.                                         <button
  507.                                                 class="button button-blueBackground goToSignInNow rowHeader__textRow__linkAndPrice__priceBox__btnSignUp"
  508.                                                 type="button" style="border: 0;padding: 0px 25px;"
  509.                                                 data-carturl="{{ path('fmUniqskillsCartIndex') }}"
  510.                                                 data-addurl="{{ path('fmProductCartFrontendAdd') }}"
  511.                                                 data-notfound="{{ path('fmUniqskillsOrderError',
  512.                                                     {'_locale': app.session.get('userLocale', 'pl'), 'slugCourse': course.slug}) }}"
  513.                                                 data-productVariantNoComplete="{{ productVariant.productVariantNoComplete }}"
  514.                                                 {% if discountCode is not null %}
  515.                                                     data-coupon="{{ discountCode.code }}"
  516.                                                 {% endif %}
  517.                                         >
  518.                                             {% if productVariant.isRecurringSubscription %}
  519.                                                 {{ 'uniqskills.landing.subscribe'|trans }}
  520.                                             {% elseif productVariant.priceNet == 0 %}
  521.                                                 {{ 'uniqskills.landing.orderAccess'|trans }}
  522.                                             {% else %}
  523.                                                 {{ 'uniqskills.landing.signInNow'|trans }}
  524.                                             {% endif %}
  525.                                         </button>
  526.                                     {% endif %}
  527.                                 </div>
  528.                             </div>
  529.                             {% endfor %}
  530.                         </div>
  531.                     {% elseif app.request.locale == 'pl' and course.defaultPrice is not empty %}
  532.                         <div class="col-4 rowHeader__textRow__linkAndPrice__priceBox">
  533.                             <div class="row">
  534.                                 <div class="col rowHeader__textRow__linkAndPrice__priceBox__title">Cena</div>
  535.                             </div>
  536.                             <div class="row">
  537.                                 <div class="col-6 rowSignUp__modal__price__oldPrice-container">
  538.                                     <div class="rowHeader__textRow__linkAndPrice__priceBox__currentPrice">
  539.                                         {% include '/uniqskills/catalogue/landing_price.html.twig' with {
  540.                                             'landingPriceNet': course.defaultPrice,
  541.                                             'landingPriceGross': course.defaultPrice,
  542.                                             'country': ''
  543.                                         } %} zł brutto
  544.                                     </div>
  545.                                 </div>
  546.                                 <div class="col-6 rowHeader__textRow__linkAndPrice__priceBox__btnSignUp-container">
  547.                                     <button
  548.                                             class="button button-blueBackground goToSignInNow rowHeader__textRow__linkAndPrice__priceBox__btnSignUp"
  549.                                             type="button" style="border: 0;">
  550.                                         {{ 'uniqskills.landing.signInNow'|trans }}
  551.                                     </button>
  552.                                 </div>
  553.                             </div>
  554.                         </div>
  555.                     {% else %}
  556.                         {% if buttonToCountryNotFound is defined and buttonToCountryNotFound %}
  557.                             <div class="col-4 rowHeader__textRow__linkAndPrice__priceBox">
  558.                                 <div class="row rowHeader-no-price">
  559.                                     <div class="col-6 rowSignUp__modal__price__oldPrice-container">
  560.                                     </div>
  561.                                     <div class="col-6 rowHeader__textRow__linkAndPrice__priceBox__btnSignUp-container">
  562.                                         <a href="{{ path(buttonToCountryNotFound.route, { request: buttonToCountryNotFound.request, slugCourse: buttonToCountryNotFound.slugCourse}) }}"
  563.                                            class="goToSignInNow rowHeader__textRow__linkAndPrice__priceBox__btnSignUp-container-link">
  564.                                             {{ 'uniqskills.landing.signInNow'|trans }}
  565.                                         </a>
  566.                                     </div>
  567.                                 </div>
  568.                             </div>
  569.                         {% endif %}
  570.                     {% endif %}
  571.                 </div>
  572.             </div>
  573.             <div class="rowHeader__textRow__linkAndPrice-overlay">
  574.                 <div class="overlay-bg-white"></div>
  575.                 <div class="overlay-bg-dark"></div>
  576.             </div>
  577.         </div>
  578.     </div>
  579. </section>