templates/App/checkout/upsell_checkout_page.html.twig line 1

Open in your IDE?
  1. {% extends "App/checkout/base_product.html.twig" %}
  2. {% block content %}
  3.     {% set currency = product.defaultCurrency|currency_symbol %}
  4.     <input type="hidden" name="purchase_order_id" value="{{ lastPaidOrder ? lastPaidOrder.id : '' }}">
  5.     <div class="container upsell-checkout step-1">
  6.         <div class="split">
  7.             <div class="split__content">
  8.                 <!-- Status Bar -->
  9.                 <div class="status-bar">
  10.                     <div class="status-item status-completed">
  11.                         <div class="status-icon">
  12.                             <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  13.                                 <circle cx="10" cy="10" r="9" fill="#1acd8e"/>
  14.                                 <path d="M6 10L9 13L14 7" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
  15.                             </svg>
  16.                         </div>
  17.                         <div class="status-label">{{ 'upsellPageProgressStep1' | trans }}</div>
  18.                     </div>
  19.                     <div class="status-connector status-connector-green"></div>
  20.                     <div class="status-item status-in-progress">
  21.                         <div class="status-icon">🟠</div>
  22.                         <div class="status-label">{{ 'upsellPageProgressStep2' | trans }}</div>
  23.                     </div>
  24.                     <div class="status-connector status-connector-orange"></div>
  25.                     <div class="status-item status-orange">
  26.                         <div class="status-icon">🟠</div>
  27.                         <div class="status-label">{{ 'upsellPageProgressStep3' | trans }}</div>
  28.                     </div>
  29.                     <!-- Label Timer -->
  30.                     {% if product.upsellPageProgressTimer > 0%}
  31.                         <div class="status-timer">
  32.                             <svg width="14" height="14" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  33.                                 <circle cx="8" cy="8" r="7" stroke="currentColor" stroke-width="1.5" fill="none"/>
  34.                                 <path d="M8 4V8L10.5 10.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
  35.                             </svg>
  36.                             <span id="labelTimerDisplay">0{{ product.upsellPageProgressTimer }}:00</span>{{ 'upsellPageProgressLabel' | trans }}
  37.                         </div>
  38.                     {% endif %}
  39.                 </div>
  40.                 <div class="page-title">
  41.                     {% if discountPercentage is defined and discountPercentage > 0 and product.upsellPageDescForNewCustomers %}
  42.                         {{ product.upsellPageDescForNewCustomers | raw }}
  43.                     {% elseif product.upsellPageDescription is not empty %}
  44.                         {{ product.upsellPageDescription | raw }}
  45.                     {% else %}
  46.                         {{ 'upsellPageTitle' | trans }}
  47.                     {% endif %}
  48.                 </div>
  49.                 <input type="hidden" value="{{ product.id }}" name="product_id">
  50.                 <input type="hidden" value="{{ isFirstOrder }}" name="is_first_order">
  51.                 {% include "App/checkout/partials/product_upsells_page.html.twig"
  52.                     with {'product': product, 'currency': currency, 'choosedUpsells': choosedUpsells, 'discountPercentage': discountPercentage}
  53.                 %}
  54.             </div>
  55.             <div class="split__content">
  56.                 <a href="#order" class="split__btn">
  57.                     <svg role="img" class="icon icon-cart">
  58.                         <use xlink:href="{{ asset('assets/svg/icons/icons.svg#icon-cart') }}"></use>
  59.                     </svg>
  60.                 </a>
  61.                 {{ form_start(form) }}
  62.                 <form class="form" method="post">
  63.                     <div class="receipt">
  64.                         <div class="select-item-title text-center">
  65.                             {{ 'upsellPageSelectItem' | trans }}
  66.                         </div>
  67.                         <div class="product-title-wrap">
  68.                             <div class="card-title skeleton"></div>
  69.                             <div class="card-title skeleton"></div>
  70.                             <div class="card-title skeleton"></div>
  71.                             <div id="product-title-block">
  72.                             </div>
  73.                         </div>
  74.                         <div class="shipping-wrap step-1">
  75.                             <div class="card-title skeleton pt-5"></div>
  76.                             <div id="shipping-block"></div>
  77.                         </div>
  78.                         <hr>
  79.                         <div class="total-wrap">
  80.                             <div class="card-title skeleton pt-5 pb-5"></div>
  81.                             <div id="total-block"></div>
  82.                         </div>
  83.                     </div>
  84.                     <hr>
  85.                     <div class="btn-wrap btn-wrap--start">
  86.                         <div class="d-flex justify-content-center w-100">
  87.                             <button type="submit" class="btn btn--sm d-flex justify-content-center align-items-center">{{ 'finishOrder'| trans }}</button>
  88.                         </div>
  89.                         <div class="d-flex justify-content-center w-100 mt-2">
  90.                             <a href="{{ skipUrl }}" class="link">{{ 'postUpsellSkipButton'| trans }}</a>
  91.                         </div>
  92.                     </div>
  93.                     {{ form_end(form) }}
  94.             </div>
  95.         </div>
  96.     </div>
  97.     <style>
  98.         .upsell-checkout .upsell-product__manage .form-control, .upsell-checkout .upsell-product__manage .input-group-append, .upsell-checkout .upsell-product__manage .input-group-append .input-group-text[role=button] {
  99.             background: #f5f5f5;
  100.         }
  101.         .status-timer span{
  102.             text-transform: uppercase;
  103.         }
  104.     </style>
  105.     <script>
  106.         document.addEventListener('DOMContentLoaded', function() {
  107.             startLabelTimer();
  108.         });
  109.         let labelTimeLeft = {{ product.upsellPageProgressTimer }} * 60;
  110.         let labelTimerInterval = null;
  111.         function startLabelTimer() {
  112.             const labelTimerDisplay = document.getElementById('labelTimerDisplay');
  113.             if (!labelTimerDisplay) return;
  114.             labelTimerInterval = setInterval(() => {
  115.                 const minutes = Math.floor(labelTimeLeft / 60);
  116.                 const seconds = labelTimeLeft % 60;
  117.                 labelTimerDisplay.textContent = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
  118.                 if (labelTimeLeft <= 0) {
  119.                     clearInterval(labelTimerInterval);
  120.                     labelTimerDisplay.textContent = '00:00';
  121.                 } else {
  122.                     labelTimeLeft--;
  123.                 }
  124.             }, 1000);
  125.         }
  126.     </script>
  127. {% endblock %}