src/DcSiteBundle/Resources/views/Toyota/Car/in-stock-single.html.twig line 1

Open in your IDE?
  1. {% extends '@DcSite/Toyota/template.html.twig' %}
  2. {% block head %}
  3.     <title>{{ model.seoTitle(app.request.locale) }}</title>
  4.     <meta name="description" content="{{ model.seoDescription(app.request.locale) }}">
  5.     <meta name="keywords" content="{{ model.seoKeywords(app.request.locale) }}">
  6.     <link rel="stylesheet" type="text/css" href="/dist/{{ MODE }}/dcsite/toyota/css/toyotaInStockCard.css?{{ VERSION }}">
  7. {% endblock head %}
  8. {% block ogtagDynamicImage %}
  9.     <meta property="og:image" content="{{ absolute_url(media_url(model.preview, 'small_in_stock')) }}">
  10. {% endblock ogtagDynamicImage %}
  11. {% block ogtagDynamic %}
  12.     <meta property="og:title" content="{{ model.seoTitle(app.request.locale) }}">
  13.     <meta property="og:description" content="{{ model.seoDescription(app.request.locale) }}">
  14. {% endblock ogtagDynamic %}
  15. {% block content %}
  16.         <section class="breadcrumbs__new">
  17.             <div class="container">
  18.                 <ol class="global_breadcrumbs__new" itemscope itemtype="https://schema.org/BreadcrumbList">
  19.                     <li class="marker__none" itemprop="itemListElement" itemscope
  20.                         itemtype="https://schema.org/ListItem">
  21.                         <a itemprop="item" href="{{ path('toyota_homepage') }}">
  22.                             <span class="breadcrumbs__link" itemprop="name">TOYOTA</span></a>
  23.                         <meta itemprop="position" content="1"/>
  24.                     </li>
  25.                     <div class="arrow-bcs"> ❯ </div>
  26.                     <li class="marker__none" itemprop="itemListElement" itemscope
  27.                         itemtype="https://schema.org/ListItem">
  28.                         <a itemprop="item" href="{{ path('toyota_in_stock_catalog') }}">
  29.                             <span class="breadcrumbs__link" itemprop="name">{{ 'base.instock'|trans({}, 'dc_toyota') }}</span></a>
  30.                         <meta itemprop="position" content="2"/>
  31.                     </li>
  32.                     <div class="arrow-bcs"> ❯ </div>
  33.                     <li itemprop="item" class="marker__none" itemprop="itemListElement" itemscope
  34.                         itemtype="https://schema.org/ListItem">
  35.                         <span style="color: #ABABAB;" class="breadcrumbs__link" itemprop="name">{{ model.fullName }}</span>
  36.                         <meta itemprop="position" content="3"/>
  37.                     </li>
  38.                 </ol>
  39.             </div>
  40.         </section>
  41.         {% set car_page_get_offer = 'pages.base.btn_order'|trans({}, 'dc_base')%}
  42.         {% include '@DcSite/Modules/car-in-stock/index.html.twig' with {onlineBuy : false, tdPath: 'toyota_service_consultation', newCreditCalc: true}  %}
  43.         {% include '@DcSite/Modules/buy-instock-car-popup.html.twig' with {actPath: 'toyota_buy_in_stock_form', model: model}  %}
  44.     {% include '@DcSite/Modules/call-me-popup.html.twig' with  {
  45.         'route': path('form_call_me', {'formType': 4}),
  46.     } %}
  47.     {% include '@DcSite/Modules/sps-popup-credit.html.twig'  with  {'homePage' :  path('toyota_homepage') } %}
  48. {% endblock content %}
  49. {% block script %}
  50.     <script src="/dist/{{ MODE }}/dcsite/toyota/js/toyotaInStockCard.js?{{ VERSION }}"></script>
  51.     <script>
  52.         $('#buy-instock-car-modal').on('submit', function (e) {
  53.             e.preventDefault();
  54.             var $form = $(this);
  55.             function formatDataLayerPhone(phone) {
  56.                 if (!phone || typeof phone !== 'string') {
  57.                     return '';
  58.                 }
  59.                 return '+' + phone.replace(/\D/g, '');
  60.             }
  61.             var phone = $form.find('.phone').val();
  62.             $.ajax({
  63.                 url: $form.attr('action'),
  64.                 type: 'POST',
  65.                 success: function () {
  66.                     try {
  67.                         dataLayer.push({
  68.                             'event': 'event-to-go',
  69.                             'eventAction': 'submit',
  70.                             'eventCategory': 'car-order',
  71.                             'eventLabel': 'order-car-stock',
  72.                             phoneInput: formatDataLayerPhone(phone)
  73.                         });
  74.                     } catch (e) {
  75.                         console.error('dataLayer event error');
  76.                     }
  77.                 },
  78.             })
  79.         });
  80.     </script>
  81.     <script>
  82.         const obj = new dcsite.toyotaInStockCard.Card();
  83.         obj.init()
  84.         obj.initSlick()
  85.         obj.initMagnificPopup()
  86.         obj.initCredit({
  87.             cretidTpl: '{{ path('dc_credit_load_tpl')  }}',
  88.             initUrl: '{{ path('dc_credit_init') }}',
  89.             brandUrl: '{{ path('dc_credit_load_brands') }}',
  90.             byDealerUrl: '{{ path('dc_credit_init_by_dealer') }}',
  91.             programsUrl: '{{ path('dc_credit_programs') }}',
  92.             saveUrl: '{{ path('dc_credit_save') }}',
  93.             privacyUrl: '{{ privacyUrl }}',
  94.             disableCarChange: true,
  95.             dealer: {{ model.vehicle.dealer.id }},
  96.             carId: {{ model.vehicle.id }},
  97.             variationId: {{ model.vehicleItemId }}
  98.         })
  99.         obj.initTradeIn({
  100.             initUrl: '{{ path('dc_ti_init') }}',
  101.             dealer: {{ model.vehicle.dealer.id }},
  102.             carId: {{ model.vehicle.id }},
  103.             variationId: {{ model.vehicleItemId }},
  104.             agreementUrl: '{{ privacyUrl }}',
  105.         })
  106.         obj.initCasco({
  107.             initUrl : '{{ path('base_casco_init') }}',
  108.             initByDealerUrl : '{{ path('base_casco_init_by_dealer') }}',
  109.             optionsUrl : '{{ path('base_casco_options') }}',
  110.             formUrl : '{{ path('base_casco_save_form') }}',
  111.             privacyUrl: '{{ privacyUrl }}',
  112.             dealer: {{ model.vehicle.dealer.id }},
  113.             carId: {{ model.vehicle.id }},
  114.             variationId: {{ model.vehicleItemId }},
  115.             disableCarChange: true
  116.         })
  117.         const objCredit = new dcsite.toyotaInStockCard.CreditInStock();
  118.         objCredit.initCreditCalcInStock({
  119.             getVehicleBrandUrl: '{{ path('dc_credit_find_brand') }}',
  120.             getVehicleModelUrl: '{{ path('dc_credit_find_model') }}',
  121.             getVehicleEquipmentUrl: '{{ path('dc_credit_find_equipment') }}',
  122.             getVehicleVariationUrl: '{{ path('dc_credit_find_variation') }}',
  123.             getVehicleUrl: '{{ path('dc_credit_get_vehicle') }}',
  124.             initCreditCalcUrl: '{{ path('dc_finance_credit_init') }}',
  125.             initTradeInUrl: '{{ path('dc_ti_init') }}',
  126.             agreementUrl: '{{ path('automarket_personal_data_agreement') }}',
  127.             loadListDocumentUrl: '{{ path('dc_credit_load_documents') }}',
  128.             schedulePaymentUrl: '{{ path('dc_credit_load_schedule_credit_pdf') }}',
  129.             getVehiclesByWalletUrl: '{{ path('dc_finance_credit_by_price') }}',
  130.             getVehiclesWithMinPriceUrl: '{{ path('dc_finance_credit_by_price_min') }}',
  131.             getCrmUUIDUrl: '{{ path('dc_finance_crm_lead_by_uuid') }}',
  132.             getCrmDataUrl: '{{ path('dc_finance_crm_create_lead') }}',
  133.             sendLeadUrl: '{{ path('dc_credit_save') }}',
  134.             ks: '{{ 'catalog.k_s'|trans({}, 'portal_base') }}',
  135.             enginePower: '{{ 'cars.engine'|trans({}, 'portal_base') }}',
  136.             translate_month: '{{ 'finance.credit.credit_month_short'|trans({}, 'portal_base') }}',
  137.             translate_under: '{{ 'finance.credit.credit_under'|trans({}, 'portal_base') }}',
  138.             translate_first_payment: '{{ 'form.first_give'|trans({}, 'portal_base') }}',
  139.             translate_uah: ' грн',
  140.             translate_not_enough_money: '{{ 'finance.credit.not_enough_money'|trans({}, 'portal_base') }}',
  141.             translate_not_estimate_vehicle: '{{ 'finance.credit.not_estimate_vehicle'|trans({}, 'portal_base') }}',
  142.             translate_min_first_payment_for_car: '{{ 'finance.credit.min_first_payment_for_car'|trans({}, 'portal_base') }}',
  143.             translate_estimate_vehicle_more_1: '{{ 'finance.credit.translate_estimate_vehicle_more_1'|trans({}, 'portal_base') }}',
  144.             translate_estimate_vehicle_more_2: '{{ 'finance.credit.translate_estimate_vehicle_more_2'|trans({}, 'portal_base') }}',
  145.             translate_unfortunately_not_enough: '{{ 'finance.credit.unfortunately_not_enough'|trans({}, 'portal_base') }}',
  146.             translate_price_of_your_car: '{{ 'finance.credit.price_of_your_car'|trans({}, 'portal_base') }}',
  147.             translate_min: '{{ 'finance.credit.min'|trans({}, 'portal_base') }}',
  148.             translate_min_first_payment: '{{ 'finance.credit.min_first_payment'|trans({}, 'portal_base') }}',
  149.             translate_min_month_payment: '{{ 'finance.credit.min_month_payment'|trans({}, 'portal_base') }}',
  150.             translate_month_term_credit: '{{ 'finance.credit.month_term_credit'|trans({}, 'portal_base') }}',
  151.             continue_first_least: '{{ 'finance.credit.continue_first_least'|trans({}, 'portal_base') }}',
  152.             translate_term_months: '{{ 'finance.credit.term_months'|trans({}, 'portal_base') }}',
  153.             translate_term_months_short: '{{ 'finance.credit.term_months_short'|trans({}, 'portal_base') }}',
  154.             translate_price_from: '{{ 'finance.credit.price_from'|trans({}, 'portal_base') }}',
  155.             privacyUrl: '{{ privacyUrl }}',
  156.             name: '{{ app.user.name | default(null) }}',
  157.             phone: '{{ app.user.phone | default(null) }}',
  158.             unsetUsedTypeVehicle: true,
  159.             unsetFlow2: true,
  160.             newCarUrl: 'toyota_one_car',
  161.             usedCarUrl: '',
  162.             brand_id: {{model.brand.id }},
  163.             dealer_id: {{model.dealer.id}},
  164.             model_id: {{ model.model.id }},
  165.             inStockId: {{ model.id }},
  166.             vehicleItemId: {{ model.vehicleItemId }},
  167.             vehicleId: '{{ model.vehicle.id }}'
  168.         });
  169.     </script>
  170.     <script type="application/ld+json">
  171.         {{ structuredCarData|raw }}
  172.     </script>
  173. {% endblock script %}