Jamil-Abdullayev b8246597d4 Initial commit: orgsteklo WordPress theme
Custom WooCommerce theme for orgsteklo.ru including:
- Product catalog with category/subcategory hierarchy
- Custom checkout with delivery calculation
- Price calculator
- Admin settings panel
- Search functionality
- User account pages
2026-03-05 00:48:06 +04:00

53 lines
2.3 KiB
PHP
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
$consult_title = get_field('consult_title', 'option');
$consult_description = get_field('consult_description', 'option');
if($consult_title) {
?>
<section class="consult">
<div class="consult-container container">
<div class="consult-main">
<div class="consult-name">
<?php
if($consult_title) {
echo '<h2>' . $consult_title . '</h2>';
}
if($consult_description) {
echo '<p>' . $consult_description . '</p>';
}
?>
</div>
<form class="consult-form" method="post" id="consult-form">
<input name="consult-url" type="hidden" value="<?php echo esc_url( home_url( add_query_arg( null, null ) ) ); ?>">
<div class="consult-form__row">
<input type="text" name="consult-name" placeholder="ФИО*" autocomplete="name" required>
<input type="tel" name="consult-phone" class="phone" placeholder="+7 (999) 999-99-99*" autocomplete="tel" required>
</div>
<input type="email" name="consult-email" placeholder="E-mail*" autocomplete="email" required>
<input type="text" name="consult-comment" placeholder="Комментарий...">
<div class="consult-checkbox">
<input type="checkbox" id="consult-checkbox">
<label for="consult-checkbox">Нажимая на кнопку, вы соглашаетесь с <a href="/privacy-policy">политикой конфиденциальности</a></label>
</div>
<button class="consult-submit" name="consult-form-submit" type="submit">Отправить заявку</button>
</form>
</div>
</div>
</section>
<?php
}
?>
<?php
$email_form = get_field('email_form', 'option');
$to = $email_form;
$subject = 'Получить индивидуальную консультацию';
$headers = array('Content-Type: text/html; charset=UTF-8');
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['consult-form-submit'])) {
$name = sanitize_text_field($_POST['consult-name']);
$phone = sanitize_text_field($_POST['consult-phone']);
$email = sanitize_text_field($_POST['consult-email']);
$comment = sanitize_text_field($_POST['consult-comment']);
$url = esc_url_raw($_POST['consult-url']);
$message = "Имя: $name<br>Телефон: $phone<br>Email: $email<br>Комментарий: $comment<br>Страница: $url";
if(wp_mail($to, $subject, $message, $headers)) {}
}
?>