Files
agroexpert/page-contacts.php
argoexpert press 009f8e40c2 add folder EN
2024-05-24 21:37:57 +03:00

123 lines
4.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/*
Template Name: Шаблон страницы контакты
*/
?>
<?php get_header( 'en' ); ?>
<div class="content-middle articles-wrapper">
<?php get_template_part('partials/rubrics-mobile'); ?>
<div class="section-title border-top">
<h1 class="section-title__title"><? the_title()?></h1>
</div>
<div class="articles-single">
<div class="contacts__map-container">
<div class="contacts__map" id="contacts_map"></div>
</div>
<div class="contacts__container">
<div class="contacts__text-block">
<p class="contacts__block-title subtitle-13">Address</p>
<p class="contacts__block-subtitle text-13">Office 12, 102/31 Prospekt Mira<br>129626, Moscow</p>
</div>
<div class="contacts__text-block">
<p class="contacts__block-title subtitle-13">Telephone</p>
<p class="contacts__block-subtitle text-13"><a href="tel:74959250634"><?=get_field('phone', 'option');?></a></p>
</div>
<div class="contacts__text-block">
<p class="contacts__block-title subtitle-13">E-mail</p>
<p class="contacts__block-email text-13"><a href="mailto:<?=get_field('email', 'option');?>"><?=get_field('email', 'option');?></a></p>
</div>
<div class="contacts__text-block">
<p class="contacts__block-title subtitle-13">To inquire about advertising, contact us</p>
<p class="contacts__block-subtitle text-13"><a href="tel:79263663700">+7 (926) 366 37 00</a></p>
<p class="contacts__block-email text-13"><a href="mailto:pr@agroexpert.press">pr@agroexpert.press</a></p>
</div>
</div>
</div>
<a href="<?= home_url() ?>/en" class="articles-preview__show-next">On top</a>
<div class="articles__spacer-container">
<div class="articles__spacer"></div>
<div class="articles__spacer"></div>
</div>
</div>
<script async src="https://api-maps.yandex.ru/2.1/?lang=ru_RU&apikey=8f62a900-d60a-4059-887b-83fe5d19d0a5"
type="text/javascript"></script>
<?php
$params = get_field('yandex_params', 'option');
?>
<script type="text/javascript">
const handleInit = () => {
ymaps.ready(init);
// Функция ymaps.ready() будет вызвана, когда
// загрузятся все компоненты API, а также когда будет готово DOM-дерево.
function init() {
// Создание карты.
var myMap = new ymaps.Map("contacts_map", {
// Координаты центра карты.
// Порядок по умолчанию: «широта, долгота».
// Чтобы не определять координаты центра карты вручную,
// воспользуйтесь инструментом Определение координат.
center: [<?= $params['latitude']?>, <?= $params['longitude']?>],
// Уровень масштабирования. Допустимые значения:
// от 0 (весь мир) до 19.
zoom: 17
});
const Place = new ymaps.Placemark([<?= $params['latitude']?>, <?= $params['longitude']?>], {
hintContent: '<?= $params['name_point']?>',
balloonContent: '',
balloonHeader: '',
}, {
iconLayout: 'default#image',
iconImageHref: '<?= $params['image_point']['url']; ?>',
iconImageSize: [36, 44],
iconShape: {
type: 'Rectangle',
coordinates: [
[-30, -93],
[30, 0]
]
}
});
myMap.geoObjects.add(Place)
}
}
document.addEventListener('DOMContentLoaded', () => {
if (typeof ymaps !== 'undefined') {
handleInit();
} else {
setTimeout(() => {
handleInit();
}, 1000)
}
} );
</script>
<script>
function handleSubmit() {
let wpcfForm = document.querySelector( '.wpcf7' );
wpcfForm.addEventListener( 'wpcf7submit', function( event ) {
var inputs = event.detail.inputs;
for ( var i = 0; i < inputs.length; i++ ) {
if(inputs[i].value === '') return;
}
}, false );
}
document.addEventListener('DOMContentLoaded', () => {
const form = document.getElementById('contact__form')
form.addEventListener('submit', handleSubmit)
});
</script>
<?php get_footer( 'en' ); ?>