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. 15
      wp-content/themes/cosmopet/templates/footer.twig
  4. 1
      wp-content/themes/cosmopet/templates/form-coupon.twig

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

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

@ -1,6 +1,9 @@
{% 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">
{# Для ОАЭ сайта #}
{% if site_region == 'ae' %}
<div class="footer-content">
@ -36,6 +39,8 @@
{% include 'forms/footer-form.twig' %}
{# Для РУ-сайта #}
{% elseif site_region == 'ru' %}
<div class="footer-top">
@ -73,6 +78,7 @@
</div>
<div class="footer-bottom">
<ul class="footer-network">
{# {{ dump( social ) }} #}
{% for item in social %}
<li>
<a href="{{item.link}}" target="_blank">
@ -90,10 +96,10 @@
</div>
</footer>
</footer>
<!-- Footer end -->
<!-- Footer end -->
@ -101,6 +107,8 @@
{% include 'forms/author-form.twig' %}
<script>
{# TO_DO перенсти в модуль соответвующий #}
function onTelegramAuth(user) {
var data = {
action: 'ontelegramauth',
@ -138,6 +146,7 @@ function onTelegramAuth(user) {
}
{# TO_DO вынести логику в шаблоны форм на беке, а не через JS переобходить #}
document.addEventListener('DOMContentLoaded', function() {
// Получаем все формы на странице
const forms = document.querySelectorAll('form');

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

Loading…
Cancel
Save