Maks | вывел соц.сети в футере и некоторые пометки TO_DO добавил

pull/36/head
parent 9033526c00
commit fcf828c11b
  1. 2
      wp-content/themes/cosmopet/modules/footer/module-ajax-controller.php
  2. 9
      wp-content/themes/cosmopet/modules/footer/module-controller.php
  3. 195
      wp-content/themes/cosmopet/templates/footer.twig
  4. 1
      wp-content/themes/cosmopet/templates/form-coupon.twig

@ -1,6 +1,6 @@
<?php <?php
/* TO_DO что за логика ? */
// Добавление и настройка колонки Telegram // Добавление и настройка колонки Telegram
add_filter('manage_users_columns', 'add_tg_account_column'); add_filter('manage_users_columns', 'add_tg_account_column');
function add_tg_account_column($columns) { function add_tg_account_column($columns) {

@ -1,11 +1,18 @@
<?php <?php
/* TO_DO почему-то здесь берется из админки, а внутри timber/context подтягивает неизвестно откуда старые значения */
global $social;
$social = get_field('social', 'options');
// Добавляем данные в контекст Timber // Добавляем данные в контекст Timber
add_filter('timber/context', function($context) { add_filter('timber/context', function($context) {
global $social;
$context['email_list'] = get_field('email_list', 'options'); $context['email_list'] = get_field('email_list', 'options');
$context['email_list_ae'] = get_field('email_list_ae', 'options'); $context['email_list_ae'] = get_field('email_list_ae', 'options');
$context['adres'] = get_field('adres', 'options'); $context['adres'] = get_field('adres', 'options');
$context['social'] = get_field('social', 'options'); // $context['social'] = get_field('social', 'options'); // вытягивало непонятно откуда
$context['social'] = $social;
$context['footer-links'] = get_field('footer-links', 'options'); $context['footer-links'] = get_field('footer-links', 'options');
return $context; return $context;
}); });

@ -1,99 +1,105 @@
{% set current_path = template_path ~ '/modules/footer' %} {% set current_path = template_path ~ '/modules/footer' %}
<footer class="footer {% if site_region == 'ae' %}footer_ae{% endif %}"> <footer class="footer {% if site_region == 'ae' %}footer_ae{% endif %}">
<div class="footer__wrapper wrapper"> <div class="footer__wrapper wrapper">
{% if site_region == 'ae' %}
<div class="footer-content"> {# Для ОАЭ сайта #}
<a href="/" class="logo"> {% if site_region == 'ae' %}
<img src="/wp-content/themes/cosmopet/static/img/svg/logo/logo-gradient.svg" alt="">
<div class="footer-content">
<a href="/" class="logo">
<img src="/wp-content/themes/cosmopet/static/img/svg/logo/logo-gradient.svg" alt="">
</a>
<p class="footer-content__address">
{{adres}}
</p>
<ul class="footer__list">
{% for item in email_list_ae %}
<li class="footer-list__item">
<p>{{item.name}}</p>
<a href="mailto:{{item.email}}">{{item.email}}</a>
</li>
{% endfor %}
</ul>
<div class="footer-bottom footer__about">
<ul class="footer-network">
{% for item in social %}
<li>
<a href="{{item.link}}" target="_blank">
<img class="social-media__icon" src="{{item.img}}">
</a> </a>
<p class="footer-content__address"> </li>
{{adres}} {% endfor %}
</p> </ul>
<ul class="footer__list"> <a href="/privacy-policy/" class="footer-about__text">Privacy Policy</a>
{% for item in email_list_ae %} <a href="/shipping-policy/" class="footer-about__text">Shipping Policy</a>
<li class="footer-list__item"> <a href="/terms-conditions/" class="footer-about__text">Terms and Conditions</a>
<p>{{item.name}}</p> </div>
<a href="mailto:{{item.email}}">{{item.email}}</a> </div>
</li>
{% endfor %} {% include 'forms/footer-form.twig' %}
</ul>
<div class="footer-bottom footer__about">
<ul class="footer-network"> {# Для РУ-сайта #}
{% for item in social %} {% elseif site_region == 'ru' %}
<li>
<a href="{{item.link}}" target="_blank"> <div class="footer-top">
<img class="social-media__icon" src="{{item.img}}"> <div class="footer-content__wrap">
</a> <div class="footer-content">
</li> <a href="/" class="logo">
{% endfor %} <img src="/wp-content/themes/cosmopet/static/img/svg/logo/logo-gradient.svg" alt="">
</ul> <span>сosmopet</span>
<a href="/privacy-policy/" class="footer-about__text">Privacy Policy</a> </a>
<a href="/shipping-policy/" class="footer-about__text">Shipping Policy</a> <p class="footer-content__address">
<a href="/terms-conditions/" class="footer-about__text">Terms and Conditions</a> {{adres}}
</div> </p>
</div> <ul>
{% for item in email_list %}
{% include 'forms/footer-form.twig' %} <li>
<p>{{item.name}}</p>
{% elseif site_region == 'ru' %} <a href="mailto:{{item.email}}">{{item.email}}</a>
</li>
<div class="footer-top"> {% endfor %}
<div class="footer-content__wrap"> </ul>
<div class="footer-content">
<a href="/" class="logo">
<img src="/wp-content/themes/cosmopet/static/img/svg/logo/logo-gradient.svg" alt="">
<span>сosmopet</span>
</a>
<p class="footer-content__address">
{{adres}}
</p>
<ul>
{% for item in email_list %}
<li>
<p>{{item.name}}</p>
<a href="mailto:{{item.email}}">{{item.email}}</a>
</li>
{% endfor %}
</ul>
</div>
<div class="footer-top__link">
<a href="https://t.me/cosmopet_bot" class="link-black">{{ function('pll_e', 'Чат бот с ветеринаром') }}</a>
</div>
</div>
<form class="footer-contact form-process" action="contact_form">
<h3 class="footer-contact__title">{{ function('pll_e', 'Форма обратной связи') }}</h3>
<input name="name" type="text" placeholder="{{ function('pll_e', 'Ваше имя') }}" class="form-inp">
<input name="email" type="email" placeholder="{{ function('pll_e', 'Эл.почта') }}" class="form-inp">
<textarea name="message" class="form-textarea" name="" placeholder="{{ function('pll_e', 'Текст обращения') }}" id=""></textarea>
<input type="hidden" name="from_url" value="{{ current_url }}">
<input type="hidden" name="form_name" value="Contact form in footer">
<button class="footer-contact__submit" type="submit">{{ function('pll_e', 'ОТПРАВИТЬ') }}</button>
</form>
</div>
<div class="footer-bottom">
<ul class="footer-network">
{% for item in social %}
<li>
<a href="{{item.link}}" target="_blank">
<img class="social-media__icon" src="{{item.img}}">
</a>
</li>
{% endfor %}
</ul>
<a href="/privacy-policy/" class="footer-about__text" target="_blank">{{ function('pll_e', 'Соглашение о конфиденциальности') }}</a>
<a href="/wp-content/uploads/2025/06/declaration_korm.pdf" class="footer-about__text" target="_blank">{{ function('pll_e', 'Декларация соответствия корма') }}</a>
<a href="/wp-content/uploads/2025/06/declaration_lakomstva.pdf" class="footer-about__text" target="_blank">{{ function('pll_e', 'Декларация соответствия лакомств') }}</a>
</div>
{% endif %}
</div> </div>
</footer> <div class="footer-top__link">
<a href="https://t.me/cosmopet_bot" class="link-black">{{ function('pll_e', 'Чат бот с ветеринаром') }}</a>
</div>
<!-- Footer end --> </div>
<form class="footer-contact form-process" action="contact_form">
<h3 class="footer-contact__title">{{ function('pll_e', 'Форма обратной связи') }}</h3>
<input name="name" type="text" placeholder="{{ function('pll_e', 'Ваше имя') }}" class="form-inp">
<input name="email" type="email" placeholder="{{ function('pll_e', 'Эл.почта') }}" class="form-inp">
<textarea name="message" class="form-textarea" name="" placeholder="{{ function('pll_e', 'Текст обращения') }}" id=""></textarea>
<input type="hidden" name="from_url" value="{{ current_url }}">
<input type="hidden" name="form_name" value="Contact form in footer">
<button class="footer-contact__submit" type="submit">{{ function('pll_e', 'ОТПРАВИТЬ') }}</button>
</form>
</div>
<div class="footer-bottom">
<ul class="footer-network">
{# {{ dump( social ) }} #}
{% for item in social %}
<li>
<a href="{{item.link}}" target="_blank">
<img class="social-media__icon" src="{{item.img}}">
</a>
</li>
{% endfor %}
</ul>
<a href="/privacy-policy/" class="footer-about__text" target="_blank">{{ function('pll_e', 'Соглашение о конфиденциальности') }}</a>
<a href="/wp-content/uploads/2025/06/declaration_korm.pdf" class="footer-about__text" target="_blank">{{ function('pll_e', 'Декларация соответствия корма') }}</a>
<a href="/wp-content/uploads/2025/06/declaration_lakomstva.pdf" class="footer-about__text" target="_blank">{{ function('pll_e', 'Декларация соответствия лакомств') }}</a>
</div>
{% endif %}
</div>
</footer>
<!-- Footer end -->
@ -101,6 +107,8 @@
{% include 'forms/author-form.twig' %} {% include 'forms/author-form.twig' %}
<script> <script>
{# TO_DO перенсти в модуль соответвующий #}
function onTelegramAuth(user) { function onTelegramAuth(user) {
var data = { var data = {
action: 'ontelegramauth', action: 'ontelegramauth',
@ -138,6 +146,7 @@ function onTelegramAuth(user) {
} }
{# TO_DO вынести логику в шаблоны форм на беке, а не через JS переобходить #}
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
// Получаем все формы на странице // Получаем все формы на странице
const forms = document.querySelectorAll('form'); const forms = document.querySelectorAll('form');

@ -1,5 +1,6 @@
{% if fn('wc_coupons_enabled') %} {% if fn('wc_coupons_enabled') %}
{# TO_DO перенести в компоненты модуля форм #}
{% set applied_coupons = fn('WC').cart.get_applied_coupons %} {% set applied_coupons = fn('WC').cart.get_applied_coupons %}
{% set has_coupon = applied_coupons is not empty %} {% set has_coupon = applied_coupons is not empty %}
{% set first_coupon = has_coupon ? applied_coupons[0] : '' %} {% set first_coupon = has_coupon ? applied_coupons[0] : '' %}

Loading…
Cancel
Save