{% extends '@DcSite/Toyota/template.html.twig' %}
{% block head %}
<title>{{ model.seoTitle(app.request.locale) }}</title>
<meta name="description" content="{{ model.seoDescription(app.request.locale) }}">
<meta name="keywords" content="{{ model.seoKeywords(app.request.locale) }}">
<link rel="stylesheet" type="text/css" href="/dist/{{ MODE }}/dcsite/toyota/css/toyotaInStockCard.css?{{ VERSION }}">
{% endblock head %}
{% block ogtagDynamicImage %}
<meta property="og:image" content="{{ absolute_url(media_url(model.preview, 'small_in_stock')) }}">
{% endblock ogtagDynamicImage %}
{% block ogtagDynamic %}
<meta property="og:title" content="{{ model.seoTitle(app.request.locale) }}">
<meta property="og:description" content="{{ model.seoDescription(app.request.locale) }}">
{% endblock ogtagDynamic %}
{% block content %}
<section class="breadcrumbs__new">
<div class="container">
<ol class="global_breadcrumbs__new" itemscope itemtype="https://schema.org/BreadcrumbList">
<li class="marker__none" itemprop="itemListElement" itemscope
itemtype="https://schema.org/ListItem">
<a itemprop="item" href="{{ path('toyota_homepage') }}">
<span class="breadcrumbs__link" itemprop="name">TOYOTA</span></a>
<meta itemprop="position" content="1"/>
</li>
<div class="arrow-bcs"> ❯ </div>
<li class="marker__none" itemprop="itemListElement" itemscope
itemtype="https://schema.org/ListItem">
<a itemprop="item" href="{{ path('toyota_in_stock_catalog') }}">
<span class="breadcrumbs__link" itemprop="name">{{ 'base.instock'|trans({}, 'dc_toyota') }}</span></a>
<meta itemprop="position" content="2"/>
</li>
<div class="arrow-bcs"> ❯ </div>
<li itemprop="item" class="marker__none" itemprop="itemListElement" itemscope
itemtype="https://schema.org/ListItem">
<span style="color: #ABABAB;" class="breadcrumbs__link" itemprop="name">{{ model.fullName }}</span>
<meta itemprop="position" content="3"/>
</li>
</ol>
</div>
</section>
{% set car_page_get_offer = 'pages.base.btn_order'|trans({}, 'dc_base')%}
{% include '@DcSite/Modules/car-in-stock/index.html.twig' with {onlineBuy : false, tdPath: 'toyota_service_consultation', newCreditCalc: true} %}
{% include '@DcSite/Modules/buy-instock-car-popup.html.twig' with {actPath: 'toyota_buy_in_stock_form', model: model} %}
{% include '@DcSite/Modules/call-me-popup.html.twig' with {
'route': path('form_call_me', {'formType': 4}),
} %}
{% include '@DcSite/Modules/sps-popup-credit.html.twig' with {'homePage' : path('toyota_homepage') } %}
{% endblock content %}
{% block script %}
<script src="/dist/{{ MODE }}/dcsite/toyota/js/toyotaInStockCard.js?{{ VERSION }}"></script>
<script>
$('#buy-instock-car-modal').on('submit', function (e) {
e.preventDefault();
var $form = $(this);
function formatDataLayerPhone(phone) {
if (!phone || typeof phone !== 'string') {
return '';
}
return '+' + phone.replace(/\D/g, '');
}
var phone = $form.find('.phone').val();
$.ajax({
url: $form.attr('action'),
type: 'POST',
success: function () {
try {
dataLayer.push({
'event': 'event-to-go',
'eventAction': 'submit',
'eventCategory': 'car-order',
'eventLabel': 'order-car-stock',
phoneInput: formatDataLayerPhone(phone)
});
} catch (e) {
console.error('dataLayer event error');
}
},
})
});
</script>
<script>
const obj = new dcsite.toyotaInStockCard.Card();
obj.init()
obj.initSlick()
obj.initMagnificPopup()
obj.initCredit({
cretidTpl: '{{ path('dc_credit_load_tpl') }}',
initUrl: '{{ path('dc_credit_init') }}',
brandUrl: '{{ path('dc_credit_load_brands') }}',
byDealerUrl: '{{ path('dc_credit_init_by_dealer') }}',
programsUrl: '{{ path('dc_credit_programs') }}',
saveUrl: '{{ path('dc_credit_save') }}',
privacyUrl: '{{ privacyUrl }}',
disableCarChange: true,
dealer: {{ model.vehicle.dealer.id }},
carId: {{ model.vehicle.id }},
variationId: {{ model.vehicleItemId }}
})
obj.initTradeIn({
initUrl: '{{ path('dc_ti_init') }}',
dealer: {{ model.vehicle.dealer.id }},
carId: {{ model.vehicle.id }},
variationId: {{ model.vehicleItemId }},
agreementUrl: '{{ privacyUrl }}',
})
obj.initCasco({
initUrl : '{{ path('base_casco_init') }}',
initByDealerUrl : '{{ path('base_casco_init_by_dealer') }}',
optionsUrl : '{{ path('base_casco_options') }}',
formUrl : '{{ path('base_casco_save_form') }}',
privacyUrl: '{{ privacyUrl }}',
dealer: {{ model.vehicle.dealer.id }},
carId: {{ model.vehicle.id }},
variationId: {{ model.vehicleItemId }},
disableCarChange: true
})
const objCredit = new dcsite.toyotaInStockCard.CreditInStock();
objCredit.initCreditCalcInStock({
getVehicleBrandUrl: '{{ path('dc_credit_find_brand') }}',
getVehicleModelUrl: '{{ path('dc_credit_find_model') }}',
getVehicleEquipmentUrl: '{{ path('dc_credit_find_equipment') }}',
getVehicleVariationUrl: '{{ path('dc_credit_find_variation') }}',
getVehicleUrl: '{{ path('dc_credit_get_vehicle') }}',
initCreditCalcUrl: '{{ path('dc_finance_credit_init') }}',
initTradeInUrl: '{{ path('dc_ti_init') }}',
agreementUrl: '{{ path('automarket_personal_data_agreement') }}',
loadListDocumentUrl: '{{ path('dc_credit_load_documents') }}',
schedulePaymentUrl: '{{ path('dc_credit_load_schedule_credit_pdf') }}',
getVehiclesByWalletUrl: '{{ path('dc_finance_credit_by_price') }}',
getVehiclesWithMinPriceUrl: '{{ path('dc_finance_credit_by_price_min') }}',
getCrmUUIDUrl: '{{ path('dc_finance_crm_lead_by_uuid') }}',
getCrmDataUrl: '{{ path('dc_finance_crm_create_lead') }}',
sendLeadUrl: '{{ path('dc_credit_save') }}',
ks: '{{ 'catalog.k_s'|trans({}, 'portal_base') }}',
enginePower: '{{ 'cars.engine'|trans({}, 'portal_base') }}',
translate_month: '{{ 'finance.credit.credit_month_short'|trans({}, 'portal_base') }}',
translate_under: '{{ 'finance.credit.credit_under'|trans({}, 'portal_base') }}',
translate_first_payment: '{{ 'form.first_give'|trans({}, 'portal_base') }}',
translate_uah: ' грн',
translate_not_enough_money: '{{ 'finance.credit.not_enough_money'|trans({}, 'portal_base') }}',
translate_not_estimate_vehicle: '{{ 'finance.credit.not_estimate_vehicle'|trans({}, 'portal_base') }}',
translate_min_first_payment_for_car: '{{ 'finance.credit.min_first_payment_for_car'|trans({}, 'portal_base') }}',
translate_estimate_vehicle_more_1: '{{ 'finance.credit.translate_estimate_vehicle_more_1'|trans({}, 'portal_base') }}',
translate_estimate_vehicle_more_2: '{{ 'finance.credit.translate_estimate_vehicle_more_2'|trans({}, 'portal_base') }}',
translate_unfortunately_not_enough: '{{ 'finance.credit.unfortunately_not_enough'|trans({}, 'portal_base') }}',
translate_price_of_your_car: '{{ 'finance.credit.price_of_your_car'|trans({}, 'portal_base') }}',
translate_min: '{{ 'finance.credit.min'|trans({}, 'portal_base') }}',
translate_min_first_payment: '{{ 'finance.credit.min_first_payment'|trans({}, 'portal_base') }}',
translate_min_month_payment: '{{ 'finance.credit.min_month_payment'|trans({}, 'portal_base') }}',
translate_month_term_credit: '{{ 'finance.credit.month_term_credit'|trans({}, 'portal_base') }}',
continue_first_least: '{{ 'finance.credit.continue_first_least'|trans({}, 'portal_base') }}',
translate_term_months: '{{ 'finance.credit.term_months'|trans({}, 'portal_base') }}',
translate_term_months_short: '{{ 'finance.credit.term_months_short'|trans({}, 'portal_base') }}',
translate_price_from: '{{ 'finance.credit.price_from'|trans({}, 'portal_base') }}',
privacyUrl: '{{ privacyUrl }}',
name: '{{ app.user.name | default(null) }}',
phone: '{{ app.user.phone | default(null) }}',
unsetUsedTypeVehicle: true,
unsetFlow2: true,
newCarUrl: 'toyota_one_car',
usedCarUrl: '',
brand_id: {{model.brand.id }},
dealer_id: {{model.dealer.id}},
model_id: {{ model.model.id }},
inStockId: {{ model.id }},
vehicleItemId: {{ model.vehicleItemId }},
vehicleId: '{{ model.vehicle.id }}'
});
</script>
<script type="application/ld+json">
{{ structuredCarData|raw }}
</script>
{% endblock script %}