templates/uniqskills/catalogue/landing_partials/payment.html.twig line 1

Open in your IDE?
  1. <div class="offer offer--ver3">
  2.     <div class="container">
  3.         <h2 class="offer-sectionHeader offerSectionHeader">
  4.             {{ 'uniqskills.landing.signInNow'|trans }}!
  5.         </h2>
  6.         <p class="offer-sectionDescription"></p>
  7.         <div class="row clearfix">
  8.             <div class="col-sm-10 col-sm-offset-1 col-md-offset-3 col-md-6">
  9.                 <div class="singleOffer singleOffer--ver3">
  10.                     <div class="singleOffer-offerName" data-mh="offerNamesGroup">
  11.                         {{ course.name }}
  12.                     </div>
  13.                     <ul class="singleOffer-offerDescription" data-mh="offerDescriptionGroup">
  14.                         {% for point in module.bulletPoints %}
  15.                             <li>{{ point.title|raw }}</li>
  16.                         {% endfor %}
  17.                     </ul>
  18.                     {% set productVariantsToDisplay = [] %}
  19.                     {# display price in usd if there are no productVariants for current user country #}
  20.                     {% if productVariants is empty %}
  21.                         {% set productVariantsToDisplay = productVariantsToDisplay|merge([{
  22.                             'productVariant': null,
  23.                             'landingProductVariant': null
  24.                         }]) %}
  25.                     {% endif %}
  26.                     {% for landingProductVariant in module.subscriptions %}
  27.                         {% for productVariant in productVariants %}
  28.                             {% if productVariant.id == landingProductVariant.subscription and productVariant.isActive %}
  29.                                 {% set productVariantsToDisplay = productVariantsToDisplay|merge([{
  30.                                     'productVariant': productVariant,
  31.                                     'landingProductVariant': landingProductVariant
  32.                                 }]) %}
  33.                             {% endif %}
  34.                         {% endfor %}
  35.                     {% endfor %}
  36.                     {% for item in productVariantsToDisplay %}
  37.                         {% set landingProductVariant = item['landingProductVariant'] %}
  38.                         {% set productVariant = item['productVariant'] %}
  39.                         {% set discountCode = null %}
  40.                         {% if
  41.                             landingProductVariant is not empty
  42.                             and landingProductVariant.discountCode is not empty
  43.                         %}
  44.                             {% for subscriptionCoupon in productVariant.coupon %}
  45.                                 {% if subscriptionCoupon.id == landingProductVariant.discountCode %}
  46.                                     {% set discountCode = subscriptionCoupon %}
  47.                                 {% endif %}
  48.                             {% endfor %}
  49.                         {% endif %}
  50.                         {% set installmentAmount = '' %}
  51.                         {% if
  52.                             productVariant is not empty
  53.                             and productVariant.installmentAmount > 1
  54.                             and productVariant.paymentType.slug == 'partial-payment'
  55.                         %}
  56.                             {% set installmentAmount = productVariant.installmentAmount ~ 'x' %}
  57.                         {% endif %}
  58.                         {% if productVariant is empty or (productVariant is not empty and productVariant.isHidden == false) %}
  59.                         <div class="singleOffer-shoppingFeatures">
  60.                                             <span class="productSpecialFeature">
  61.                                                 {{ productVariant is not empty
  62.                                                 ? productVariant.altTradeName
  63.                                                     ? productVariant.altTradeName
  64.                                                     : productVariant.tradeName
  65.                                                 : '' }}
  66.                                             </span>
  67.                             <div class="singleOffer-priceInfo">
  68.                                 <div class="singleOffer-priceInfo-container">
  69.                                     {% if discountCode is not null
  70.                                      and discountCode.isActive == true
  71.                                      and date(discountCode.dateFrom) <= date()
  72.                                      and date(discountCode.dateTo) >= date() %}
  73.                                         {% if discountCode.couponType.name == 'amountCoupon'
  74.                                         and discountCode.couponType.isActive == true %}
  75.                                             {% set landingPriceNet = (productVariant.getFullPrice('net') - discountCode.discount) %}
  76.                                             {% set tax = (landingPriceNet * productVariant.masterProduct.vatRate) / 100 %}
  77.                                             {% set landingPriceGross = (landingPriceNet + tax)|round(2)|number_format(2) %}
  78.                                         {% else %}
  79.                                             {% set landingPriceNet = (productVariant.getFullPrice('net') - (productVariant.getFullPrice('net') * (discountCode.discount * 0.01)))|number_format(2) %}
  80.                                             {% set landingPriceGross = (productVariant.getFullPrice('gross') - (productVariant.getFullPrice('gross') * (discountCode.discount * 0.01)))|number_format(2) %}
  81.                                         {% endif %}
  82.                                         <div class="productPrice-oldPrice">
  83.                                                             <span>
  84.                                                                 {{ installmentAmount }}
  85.                                                                 {% include '/uniqskills/catalogue/landing_price.html.twig' with {
  86.                                                                     'landingPriceNet': productVariant.getFullPrice('net'),
  87.                                                                     'landingPriceGross': productVariant.getFullPrice('gross'),
  88.                                                                     'country': productVariant.country
  89.                                                                 } %}
  90.                                                                 {% if productVariant.country.slug == 'poland' %} netto {% endif %}
  91.                                                             </span>
  92.                                         </div>
  93.                                         <div class="productPrice-newPrice">
  94.                                                             <span>
  95.                                                                 {{ installmentAmount }}
  96.                                                                 {% include '/uniqskills/catalogue/landing_price.html.twig' with {
  97.                                                                     'landingPriceNet': landingPriceNet,
  98.                                                                     'landingPriceGross': landingPriceGross,
  99.                                                                     'country': productVariant.country
  100.                                                                 } %}
  101.                                                                 {% if productVariant.country.slug == 'poland' %} netto {% endif %}
  102.                                                             </span>
  103.                                         </div>
  104.                                         {% if productVariant.country.slug == 'poland' %}
  105.                                             <div class="productPrice-newPriceBrutto">
  106.                                                 {{ installmentAmount }}
  107.                                                 {{ landingPriceGross }}
  108.                                                 {{ productVariant.country.currency.code }} brutto
  109.                                             </div>
  110.                                         {% elseif productVariant.country.countrySettings is not empty %}
  111.                                             <div class="productPrice-newPriceBrutto">
  112.                                                 {{ productVariant.country.countrySettings.priceCurrency }}
  113.                                             </div>
  114.                                         {% endif %}
  115.                                     {% else %}
  116.                                         <div class="productPrice-newPrice">
  117.                                                             <span>
  118.                                                                 {{ installmentAmount }}
  119.                                                                 {% if productVariant is not empty %}
  120.                                                                     {% include '/uniqskills/catalogue/landing_price.html.twig' with {
  121.                                                                         'landingPriceNet': productVariant.getFullPrice('net'),
  122.                                                                         'landingPriceGross': productVariant.getFullPrice('gross'),
  123.                                                                         'country': productVariant.country
  124.                                                                     } %}
  125.                                                                     {% if productVariant.country.slug == 'poland' %} netto {% endif %}
  126.                                                                 {% else %}
  127.                                                                     {% if app.request.locale == "pl" %}
  128.                                                                         {{ course.defaultPrice }} PLN
  129.                                                                     {% elseif app.request.locale == "en-us" or app.request.locale == 'de' %}
  130.                                                                         {{ course.defaultPrice }} EUR
  131.                                                                     {% else %}
  132.                                                                         {{ course.defaultPrice }} USD
  133.                                                                     {% endif %}
  134.                                                                 {% endif %}
  135.                                                             </span>
  136.                                         </div>
  137.                                         {% if productVariant is not empty %}
  138.                                             {% if productVariant.country.slug == 'poland' %}
  139.                                                 <div class="productPrice-newPriceBrutto">
  140.                                                     {{ installmentAmount }}{{ productVariant.getFullPrice('gross') }}
  141.                                                     {{ productVariant.country.currency.code }} brutto
  142.                                                 </div>
  143.                                             {% elseif productVariant.country.countrySettings is not empty %}
  144.                                                 <div class="productPrice-newPriceBrutto">
  145.                                                     {{ productVariant.country.countrySettings.priceCurrency }}
  146.                                                 </div>
  147.                                             {% endif %}
  148.                                         {% endif %}
  149.                                     {% endif %}
  150.                                     {% if landingProductVariant.description is defined %}
  151.                                         <div class="productPrice-priceInfo">
  152.                                             {{ landingProductVariant.description }}
  153.                                         </div>
  154.                                     {% endif %}
  155.                                 </div>
  156.                                 <div id="priceButtons">
  157.                                     {% if productVariant is not empty %}
  158.                                         <button
  159.                                            class="button button-blueBackground addToCart"
  160.                                            type="button" style="border: 0;"
  161.                                            data-carturl="{{ path('fmUniqskillsCartIndex') }}"
  162.                                            data-addurl="{{ path('fmProductCartFrontendAdd') }}"
  163.                                            data-notfound="{{ path('fmUniqskillsOrderError',
  164.                                                {'_locale': app.session.get('userLocale', 'pl'), 'slugCourse': course.slug}) }}"
  165.                                            data-productVariantNoComplete="{{ productVariant.productVariantNoComplete }}"
  166.                                            {% if discountCode is not null %}
  167.                                                data-coupon="{{ discountCode.code }}"
  168.                                            {% endif %}
  169.                                            onclick="{{ gaDataLayerUS('add_to_cart', productVariant.id) }}{{ ga4('add_to_cart', productVariant.id)|raw }}"
  170.                                         ><img src="" onerror="{{ gaDataLayerUS('prod_details_impression', productVariant.id, {'class': 'ProductVariant'})|raw }}">
  171.                                             {% if productVariant.priceNet == 0 %}
  172.                                                 {{ 'uniqskills.landing.orderAccess'|trans }}
  173.                                             {% else %}
  174.                                                 {{ 'uniqskills.landing.signInNow'|trans }}
  175.                                             {% endif %}
  176.                                         </button>
  177.                                     {% elseif buttonToCountryNotFound is defined and buttonToCountryNotFound %}
  178.                                         <a href="{{ path(buttonToCountryNotFound.route, { request: buttonToCountryNotFound.request, slugCourse: buttonToCountryNotFound.slugCourse}) }}" class="button button-blueBackground">
  179.                                             {{ 'uniqskills.landing.signInNow'|trans }}
  180.                                         </a><img src="" onerror="{{ gaDataLayerUS('prod_details_impression', course.id, {'class': 'Course'})|raw }}">
  181.                                     {% endif %}
  182.                                     {% if productVariant is not empty and productVariant.isGiftable and productVariant.buyMaxOne is not empty %}
  183.                                         <button
  184.                                            class="button button-blueBackground giftButton addToCart"
  185.                                            type="submit" style="margin-top: 10px;"
  186.                                            data-carturl="{{ path('fmUniqskillsCartIndex') }}"
  187.                                            data-addurl="{{ path('fmProductCartFrontendAdd') }}"
  188.                                            data-notfound="{{ path('fmUniqskillsOrderError',
  189.                                                {'_locale': app.session.get('userLocale', 'pl'), 'slugCourse': course.slug}) }}"
  190.                                            data-productVariantNoComplete="{{ productVariant.productVariantNoComplete }}"
  191.                                            data-isGift="true"
  192.                                            {% if discountCode is not null %}
  193.                                                data-coupon="{{ discountCode.code }}"
  194.                                            {% endif %}
  195.                                            onclick="{{ gaDataLayerUS('add_to_cart', productVariant.id) }}{{ ga4('add_to_cart', productVariant.id)|raw }}"
  196.                                         >
  197.                                             {{ 'uniqskills.landing.buyGift'|trans }}
  198.                                         </button>
  199.                                     {% endif %}
  200.                                 </div>
  201.                             </div>
  202.                         </div>
  203.                         {% endif %}
  204.                     {% endfor %}
  205.                 </div>
  206.             </div>
  207.         </div>
  208.     </div>
  209. </div>