Compare commits

...

11 Commits

  1. 2
      .gitignore
  2. 14
      robots.txt
  3. 5
      wp-content/themes/cosmopet/functions.php
  4. 25
      wp-content/themes/cosmopet/global-functions/multisite-functions.php
  5. 6
      wp-content/themes/cosmopet/modules/blog/components/featured-slider/assets/css/gp-style-desktop.css
  6. 96
      wp-content/themes/cosmopet/modules/forms/module-ajax-controller.php
  7. 0
      wp-content/themes/cosmopet/modules/layout/assets/css/core-styles.css
  8. 4
      wp-content/themes/cosmopet/modules/profile/components/subscription_single/component-controller.php
  9. 2
      wp-content/themes/cosmopet/modules/profile/components/subscriptions/component-controller.php
  10. 43
      wp-content/themes/cosmopet/modules/shop/module-controller.php
  11. 4
      wp-content/themes/cosmopet/modules/static-pages/front-page/template-front-page.php
  12. 129
      wp-content/themes/cosmopet/modules/static-pages/new-front-page copy/template-new-front-page.php
  13. 15
      wp-content/themes/cosmopet/modules/static-pages/new-front-page/template-new-front-page.php
  14. 0
      wp-content/themes/cosmopet/static/css/front-page-style.css
  15. 55
      wp-content/themes/cosmopet/static/css/new-front-page-style.css
  16. 40
      wp-content/themes/cosmopet/temp-functions/woocommerce-logic.php
  17. 2
      wp-content/themes/cosmopet/templates/_pages/about.twig
  18. 7
      wp-content/themes/cosmopet/templates/_pages/production.twig
  19. 2
      wp-content/themes/cosmopet/templates/blog/comments/comment-single.twig
  20. 2
      wp-content/themes/cosmopet/templates/layout.twig
  21. 2
      wp-content/themes/cosmopet/templates/modal/rewiew_modal.twig
  22. 0
      wp-content/themes/cosmopet/templates/shop/product-single_page.twig
  23. 4
      wp-content/themes/cosmopet/templates/shop/review-order.twig
  24. 10
      wp-content/themes/cosmopet/woocommerce/cart/cart-shipping.php
  25. 4
      wp-content/themes/cosmopet/woocommerce/checkout/review-order.php

2
.gitignore vendored

@ -3,7 +3,7 @@
# GP | SEO
sitemap*.xml
!robots.txt
robots.txt
yandex_*.html
google_*.html
yandex_turbo.xml

@ -15,12 +15,7 @@ Disallow: */embed
Disallow: */wlwmanifest.xml
Disallow: /xmlrpc.php
Allow: */uploads
<<<<<<< HEAD
Sitemap: https://cosmopet.ru/sitemap_index.xml
=======
Sitemap: https://cosmopet.ae/sitemap_index.xml
>>>>>>> 2323f31 (Fix | bug fix)
User-agent: GoogleBot
Disallow: /cgi-bin
Disallow: /?
@ -51,12 +46,7 @@ Allow: /wp-*.jpg
Allow: /wp-*.jpeg
Allow: /wp-*.gif
Allow: /wp-admin/admin-ajax.php
<<<<<<< HEAD
Sitemap: https://cosmopet.ru/sitemap_index.xml
=======
Sitemap: https://cosmopet.ae/sitemap_index.xml
>>>>>>> 2323f31 (Fix | bug fix)
User-agent: Yandex
Disallow: /cgi-bin
Disallow: /?
@ -81,11 +71,7 @@ Allow: /wp-*.jpg
Allow: /wp-*.jpeg
Allow: /wp-*.gif
Allow: /wp-admin/admin-ajax.php
<<<<<<< HEAD
Sitemap: https://cosmopet.ru/sitemap_index.xml
=======
Sitemap: https://cosmopet.ae/sitemap_index.xml
>>>>>>> 2323f31 (Fix | bug fix)
Clean-Param: utm_source&utm_medium&utm_campaign&etext&add-to-cart&per_page&per_row&from&attribute_pa_weight&attribute_pa_ves-upakovki
Clean-Param: openstat

@ -22,4 +22,7 @@ require_once __DIR__ . '/temp-functions/login-logic.php';
// include_module('profile');
// include_module('footer');
// include_module('author');
// include_module('layout');
// include_module('layout');

@ -27,6 +27,7 @@ add_filter('timber/twig', function (\Twig\Environment $twig) {
global $site_env;
$twig->addGlobal('site_region', $site_env->site_region);
$twig->addGlobal('site_env', $site_env);
$twig->addGlobal('site_mode', $site_env->site_mode);
$twig->addGlobal('header_scripts', get_field('header_scripts', 'option'));
return $twig;
});
@ -83,7 +84,7 @@ if ($site_env->site_mode == 'production' && $site_env->site_region == 'ae') {
fbq('track', 'ViewContent', {
content_ids: ['<?php echo $product->get_id(); ?>'],
content_type: 'product',
value: <?php echo $product->get_price(); ?>,
value: <?php echo round_price_with_tax($product->get_price()); ?>,
currency: '<?php echo get_woocommerce_currency(); ?>'
});
});
@ -152,7 +153,7 @@ if ($site_env->site_mode == 'production' && $site_env->site_region == 'ae') {
<script>
document.addEventListener('DOMContentLoaded', function() {
fbq('track', 'AddPaymentInfo', {
value: <?php echo $cart_total; ?>,
value: <?php echo round_price_with_tax($cart_total); ?>,
currency: '<?php echo $currency; ?>'
});
@ -161,7 +162,7 @@ if ($site_env->site_mode == 'production' && $site_env->site_region == 'ae') {
'event': 'add_payment_info',
'ecommerce': {
'currency': '<?php echo $currency; ?>',
'value': <?php echo $cart_total; ?>
'value': <?php echo round_price_with_tax($cart_total); ?>
}
});
});
@ -183,7 +184,7 @@ if ($site_env->site_mode == 'production' && $site_env->site_region == 'ae') {
$items[] = [
'item_id' => $product->get_id(),
'item_name' => $product->get_name(),
'price' => $product->get_price(),
'price' => round_price_with_tax($product->get_price()),
'quantity' => $item->get_quantity()
];
}
@ -191,7 +192,7 @@ if ($site_env->site_mode == 'production' && $site_env->site_region == 'ae') {
<script>
document.addEventListener('DOMContentLoaded', function() {
fbq('track', 'Purchase', {
value: <?php echo $order->get_total(); ?>,
value: <?php echo round_price_with_tax($order->get_total()); ?>,
currency: '<?php echo $order->get_currency(); ?>',
content_ids: [<?php echo implode(',', array_column($items, 'item_id')); ?>],
content_type: 'product'
@ -202,7 +203,7 @@ if ($site_env->site_mode == 'production' && $site_env->site_region == 'ae') {
'event': 'purchase',
'ecommerce': {
'currency': '<?php echo $order->get_currency(); ?>',
'value': <?php echo $order->get_total(); ?>,
'value': <?php echo round_price_with_tax($order->get_total()); ?>,
'items': <?php echo json_encode($items); ?>
}
});
@ -227,7 +228,7 @@ if ($site_env->site_mode == 'production' && $site_env->site_region == 'ae') {
$items[] = [
'id' => $product->get_id(),
'name' => $product->get_name(),
'price' => $product->get_price(),
'price' => round_price_with_tax($product->get_price()),
'quantity' => $item->get_quantity()
];
}
@ -316,7 +317,7 @@ add_action('wp_head', function() {
$context['product'] = [
'id' => $product->get_id(),
'name' => $product->get_name(),
'price' => floatval($product->get_price()),
'price' => round_price_with_tax(floatval($product->get_price())),
'sku' => $product->get_sku(),
'category' => wp_get_post_terms($product->get_id(), 'product_cat', ['fields' => 'names'])[0] ?? '',
];
@ -326,7 +327,7 @@ add_action('wp_head', function() {
// Страница чекаута - InitiateCheckout
$context['pixel_event_type'] = 'InitiateCheckout';
if (WC()->cart && !WC()->cart->is_empty()) {
$context['cart_total'] = floatval(WC()->cart->get_total('edit'));
$context['cart_total'] = round_price_with_tax(floatval(WC()->cart->get_total('edit')));
$context['cart_items'] = [];
$context['content_ids'] = [];
@ -336,7 +337,7 @@ add_action('wp_head', function() {
$item_data = [
'item_id' => $product->get_id(),
'item_name' => $product->get_name(),
'price' => floatval($product->get_price()),
'price' => round_price_with_tax(floatval($product->get_price())),
'quantity' => intval($cart_item['quantity']),
'category' => wp_get_post_terms($product->get_id(), 'product_cat', ['fields' => 'names'])[0] ?? '',
];
@ -363,7 +364,7 @@ add_action('wp_head', function() {
$order_items[] = [
'item_id' => $product->get_id(),
'item_name' => $product->get_name(),
'price' => floatval($item->get_total() / $item->get_quantity()),
'price' => round_price_with_tax(floatval($item->get_total() / $item->get_quantity())),
'quantity' => intval($item->get_quantity()),
'category' => wp_get_post_terms($product->get_id(), 'product_cat', ['fields' => 'names'])[0] ?? '',
];
@ -374,7 +375,7 @@ add_action('wp_head', function() {
$context['order'] = [
'id' => $order->get_id(),
'total' => floatval($order->get_total()),
'total' => round_price_with_tax(floatval($order->get_total())),
'currency' => $order->get_currency(),
'items' => $order_items,
'content_ids' => $content_ids,

@ -33,7 +33,7 @@
border-radius: 60px;
overflow: hidden;
display: flex;
align-items: flex-start;
align-items: stretch;
gap: 24px;
position: relative;
}
@ -54,7 +54,7 @@
width: 395px;
border-radius: 60px;
overflow: hidden;
height: 393px;
height: auto;
flex-shrink: 0;
}
.home-card__img:hover img{
@ -69,7 +69,7 @@
}
.home-card__content {
padding: 32px 79px 0 0;
padding: 32px 79px 100px 0;
}
.home-card__content-title {

@ -276,21 +276,39 @@ function send_order_data($order_id) {
$customer_name = $order->get_billing_first_name() . ' ' . $order->get_billing_last_name();
$customer_phone = $order->get_billing_phone();
$customer_email = $order->get_billing_email();
$order_total = $order->get_total();
$order_total = round_price_with_tax($order->get_total());
$order_comment = '';
$utm = get_utm_data()['utm_source'];
$url = '';
$fName = 2;
// 2. Формируем список товаров
// 2. Формируем список товаров с полной ценой (включая НДС)
foreach ($order->get_items() as $item) {
$product = $item->get_product();
// Используем get_total_tax() + get_total() для получения полной цены с НДС
$item_total_without_tax = $item->get_total();
$item_tax = $item->get_total_tax();
$item_total_with_tax = round_price_with_tax($item_total_without_tax + $item_tax);
$order_comment .= sprintf(
"%s x %s = %s\n",
$product->get_name(),
$item->get_quantity(),
wc_price($item->get_total())
strip_tags(wc_price($item_total_with_tax))
);
}
// 3. Добавляем информацию о промокодах, если они использовались
$coupons = $order->get_coupon_codes();
if (!empty($coupons)) {
$order_comment .= "\n=== ПРОМОКОДЫ ===\n";
foreach ($coupons as $coupon_code) {
$coupon = new WC_Coupon($coupon_code);
$discount_amount = round_price_with_tax($order->get_discount_total());
$order_comment .= "Промокод: {$coupon_code}\n";
$order_comment .= "Скидка: " . strip_tags(wc_price($discount_amount)) . "\n";
}
}
$order_comment .= "\n=== ДАННЫЕ ДОСТАВКИ ===\n";
$order_comment .= "Город: " . $order->get_billing_city() . "\n";
$order_comment .= "Адрес: " . $order->get_billing_address_1() . "\n";
@ -302,11 +320,8 @@ function send_order_data($order_id) {
if (is_user_logged_in()) {
$user_id = get_current_user_id();
}
else{
} else {
$user_id = '';
}
$form_title = 'Покупка на сайте';
$formData = [
@ -319,7 +334,7 @@ function send_order_data($order_id) {
'ORDER_ID' => $order_id,
'ORDER_TOTAL' => $order_total,
'PAYMENT_METHOD' => $order->get_payment_method_title(),
'COMMENTS' => $order_comment,
'COMMENTS' => $clean_order_comment,
// Адрес (префикс ADDR_)
'ADDR_CITY' => $order->get_billing_city(),
@ -341,40 +356,75 @@ function send_order_data($order_id) {
$product_summary = "🛒 Состав заказа:\n\n";
foreach ($order->get_items() as $item) {
$product = $item->get_product();
$formData["PRODUCT_{$product_index}_NAME"] = $product->get_name();
$formData["PRODUCT_{$product_index}_QTY"] = $item->get_quantity();
$formData["PRODUCT_{$product_index}_PRICE"] = $item->get_total();
$formData["PRODUCT_{$product_index}_SKU"] = $product->get_sku();
// Добавляем в текстовую сводку
$product_summary .= "{$product_index}) {$name}\n";
$product_summary .= " Кол-во: {$qty}\n";
$product_summary .= " Сумма: {$total}\n";
if ($sku) {
$product_summary .= " Артикул: {$sku}\n";
$product_name = $product->get_name();
$product_qty = $item->get_quantity();
$product_total_without_tax = $item->get_total();
$product_tax = $item->get_total_tax();
$product_total_with_tax = round_price_with_tax($product_total_without_tax + $product_tax);
$product_sku = $product->get_sku();
$formData["PRODUCT_{$product_index}_NAME"] = $product_name;
$formData["PRODUCT_{$product_index}_QTY"] = $product_qty;
$formData["PRODUCT_{$product_index}_PRICE"] = $product_total_with_tax;
$formData["PRODUCT_{$product_index}_SKU"] = $product_sku;
// Добавляем в текстовую сводку с полной ценой
$product_summary .= "{$product_index}) {$product_name}\n";
$product_summary .= " Кол-во: {$product_qty}\n";
$product_summary .= " Сумма: " . strip_tags(wc_price($product_total_with_tax)) . "\n";
if ($product_sku) {
$product_summary .= " Артикул: {$product_sku}\n";
}
$product_summary .= "\n";
$product_index++;
}
// Добавляем информацию о промокодах в сводку товаров
$coupons = $order->get_coupon_codes();
if (!empty($coupons)) {
$product_summary .= "=== ПРОМОКОДЫ ===\n";
foreach ($coupons as $coupon_code) {
$coupon = new WC_Coupon($coupon_code);
$discount_amount = round_price_with_tax($order->get_discount_total());
$product_summary .= "Промокод: {$coupon_code}\n";
$product_summary .= "Скидка: " . strip_tags(wc_price($discount_amount)) . "\n";
}
$product_summary .= "\n";
}
// Функция для очистки текста от HTML-сущностей
function clean_text_for_telegram($text) {
// Удаляем HTML-теги
$text = strip_tags($text);
// Заменяем HTML-сущности на обычные символы
$text = html_entity_decode($text, ENT_QUOTES | ENT_HTML5, 'UTF-8');
// Убираем лишние пробелы
$text = preg_replace('/\s+/', ' ', $text);
return trim($text);
}
$message = "📋 Данные формы:\n\n";
foreach ($formData as $key => $value) {
if (is_array($value)) {
$value = implode(', ', $value); // на случай, если в значении массив
}
$message .= sprintf("%s: %s\n", $key, $value);
$message .= sprintf("%s: %s\n", $key, clean_text_for_telegram($value));
}
// Очищаем тексты от HTML-сущностей для Telegram
$clean_product_summary = clean_text_for_telegram($product_summary);
$clean_order_comment = clean_text_for_telegram($order_comment);
$crmData = array(
'phone' => $customer_phone,
'name' => $customer_name,
'email' => $customer_email,
'msg' => $product_summary,
'msg' => $clean_product_summary,
'url' => null,
'stage' => 'C2:UC_ZMY1QV',
'fName' => 2,
'order_total' => $order_total,
'user_id' => $user_data['user_id'],
'user_id' => $user_id,
'method' => 'crm.deal.add',
'form_title' => 'Заказ на сайте',
'is_subscribe' => false,
@ -393,7 +443,7 @@ function notify_order_paid($order_id) {
'TITLE' => 'Заказ #' . $order_id . ' оплачен',
'ORDER_ID' => $order_id,
'PAYMENT_METHOD' => $order->get_payment_method_title(),
'ORDER_TOTAL' => $order->get_total(),
'ORDER_TOTAL' => round_price_with_tax($order->get_total()),
'SOURCE' => 'WooCommerce',
];

@ -69,7 +69,7 @@ if (!$subscription || !wcs_is_subscription($subscription) || $subscription->get_
'variation_details' => $variation_details,
],
'quantity' => $item->get_quantity(),
'total' => $item->get_total(),
'total' => round_price_with_tax($item->get_total()),
];
}, $subscription->get_items());
@ -93,7 +93,7 @@ if (!$subscription || !wcs_is_subscription($subscription) || $subscription->get_
'last_order_date' => $subscription->get_date('last_order_date_created'),
'next_payment_date' => $subscription->get_date('next_payment'),
'payment_method_title' => $subscription->get_payment_method_title(),
'total' => $subscription->get_total(),
'total' => round_price_with_tax($subscription->get_total()),
'currency' => $subscription->get_currency(),
'items' => $items,
'cancel_url' => $cancel_url,

@ -35,7 +35,7 @@ foreach ($subscriptions as $subscription) {
$subscription_data[] = [
'id' => $subscription->get_id(),
'date_created' => $subscription->get_date_created(),
'total' => $subscription->get_total(),
'total' => round_price_with_tax($subscription->get_total()),
'currency' => $subscription->get_currency(),
'billing_period' => $subscription->get_billing_period(),
'next_payment_date' => $subscription->get_date('next_payment'),

@ -401,3 +401,46 @@ function map_attr_slugs_to_class($slug) {
return $slug_map[$slug] ?? $slug; // Fallback to original slug if not found
}
// Изменение цены доставки на разбиение НДС + основная стоимость
add_filter( 'woocommerce_package_rates', function( $rates, $package ) {
foreach ( $rates as $rate_id => $rate ) {
// Цена от плагина (итоговая с налогом)
$final_shipping_with_tax = $rate->cost;
// Получаем налоговую ставку для этого метода
$tax_rates = WC_Tax::get_rates( $rate->tax_class );
if ( empty( $tax_rates ) ) {
continue; // если нет налога
}
// Берём первую найденную ставку
$tax_rate_key = key( $tax_rates );
$tax_rate_data = reset( $tax_rates );
$tax_percent = floatval( $tax_rate_data['rate'] );
// Считаем коэффициент
$coef = 1 / ( 1 + $tax_percent / 100 );
// Цена без налога
$base_shipping = round( $final_shipping_with_tax * $coef, wc_get_price_decimals() );
// Налог как разница
$tax_amount = round( $final_shipping_with_tax - $base_shipping, wc_get_price_decimals() );
// Устанавливаем
$rate->cost = $base_shipping;
// Заполняем налоги корректно для WooCommerce
$taxes_array = array_fill_keys( array_keys( WC_Tax::get_rates( $rate->tax_class ) ), 0 );
$taxes_array[$tax_rate_key] = $tax_amount;
$rate->taxes = $taxes_array;
}
return $rates;
}, 100, 2 );

@ -11,9 +11,9 @@ function theme_enqueue_scripts() {
wp_enqueue_style('gp-front-page-materialize-css', get_template_directory_uri() . '/static/css/libs/materialize.min.css');
wp_enqueue_style('gp-shop-style', get_template_directory_uri() . '/static/css/shop.css');
wp_enqueue_style('gp-forms-style', get_template_directory_uri() . '/static/css/forms.css');
wp_enqueue_style('gp-front-page-style', get_template_directory_uri() . '/static/css/front-page.css');
wp_enqueue_style('gp-front-page-style', get_template_directory_uri() . '/static/css/front-page-style.css');
wp_enqueue_script( 'gp-front-page-materialize', get_template_directory_uri() . '/static/js/libs/materialize.min.js', array(), null, true );
wp_enqueue_script( 'gp-front-page-main', get_template_directory_uri() . '/static/js/front-page.js', array(), null, true );
wp_enqueue_script( 'gp-front-page-main', get_template_directory_uri() . '/static/js/front-page.js', [], filemtime(get_template_directory_uri() . '/static/js/front-page.js'), true );
}
add_action('wp_enqueue_scripts', 'theme_enqueue_scripts');

@ -0,0 +1,129 @@
<?php
/**
* Template Name: New Main Page
* Description: Front page template
*/
if (!class_exists('Timber')) {
echo 'Timber не установлен. Пожалуйста, активируйте плагин Timber.';
return;
}
function enqueue_custom_gallery_assets() {
// Fancybox 5
wp_enqueue_style(
'fancybox-css',
'https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.css',
[],
null
);
wp_enqueue_script(
'fancybox-js',
'https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.js',
[],
null,
true
);
// Инициализация Fancybox
wp_add_inline_script('fancybox-js', "
document.addEventListener('DOMContentLoaded', function () {
Fancybox.bind('[data-fancybox=\"gallery\"]', {});
});
");
}
add_action('wp_enqueue_scripts', 'enqueue_custom_gallery_assets');
function theme_enqueue_scripts() {
wp_enqueue_style('gp-front-page-materialize-css', get_template_directory_uri() . '/static/css/libs/materialize.min.css');
wp_enqueue_style(
'gp-front-page-style-2',
get_template_directory_uri() . '/static/css/front-page-style.css',
array(),
filemtime(get_template_directory() . '/static/css/front-page-style.css')
);
wp_enqueue_style(
'gp-front-page-style',
get_template_directory_uri() . '/static/css/new-front-page-style.css',
array(),
filemtime(get_template_directory() . '/static/css/new-front-page-style.css')
);
wp_enqueue_script('gp-front-page-materialize', get_template_directory_uri() . '/static/js/libs/materialize.min.js', array(), null, true);
wp_enqueue_script('gp-front-page-main', get_template_directory_uri() . '/static/js/new-front-page.js', array(), null, true);
}
add_action('wp_enqueue_scripts', 'theme_enqueue_scripts');
include_component('blog', 'main-page-block');
include_component('shop', 'product-card');
$reviews_food_query = get_posts(array(
'post_type' => 'p_reviews',
'numberposts' => -1,
'meta_key' => 'food_enable',
'meta_value' => true,
'meta_compare' => '='
));
$reviews_treats_query = get_posts(array(
'post_type' => 'p_reviews',
'numberposts' => -1,
'meta_key' => 'treats_enable',
'meta_value' => true,
'meta_compare' => '='
));
$context = Timber::context();
if (function_exists('get_field')) {
//products
$context['reviews_treats_query'] = $reviews_treats_query;
$context['reviews_food_query'] = $reviews_food_query;
// main
$context['main_slider'] = get_field('main_slider');
// about
$context['main_about_title'] = get_field('main_about-title');
$context['main_about_image'] = get_field('main_about-image');
$context['main_about_text'] = get_field('main_about-text');
$context['main_about_banner_bg'] = get_field('main_about-banner-bg');
$context['main_about_banner_title'] = get_field('main_about-banner-title');
$context['main_about_banner_descr'] = get_field('main_about-banner-descr');
// why
$context['main_why_title'] = get_field('main_why-title');
$context['main_why_items'] = get_field('main_why-items');
$context['main_why_text'] = get_field('main_why-text');
$context['main_why_logos'] = get_field('main_why-logos');
// ingredients
$context['main_ingredients_title'] = get_field('main_ingredients-title');
$context['main_ingredients_slider'] = get_field('main_ingredients-slider');
// specialists
$context['main_specialists_title'] = get_field('main_specialists-title');
$context['main_specialists_items'] = get_field('main_specialists-items');
// cosmopetx
$context['other_post'] = Timber::get_post(383); // Загружаем пост с ID 383
//quiz
$context['q_title'] = get_field('q_title');
$context['reviews_title'] = get_field('reviews_title');
$context['q_1'] = get_field('q_1', 383);
$context['q_2'] = get_field('q_2', 383);
$context['q_3'] = get_field('q_3', 383);
$context['q_4'] = get_field('q_4', 383);
$context['q_5'] = get_field('q_5', 383);
//
$context['food_list'] = get_field('featured_food');
$context['treats_list'] = get_field('featured_treats');
}
try {
Timber::render('_pages/new-front-page.twig', $context); // Рендерим отдельный Twig-шаблон
} catch (Exception $e) {
error_log('Ошибка рендеринга: ' . $e->getMessage());
echo 'Произошла ошибка при рендеринге шаблона. Проверь логи: ' . $e->getMessage();
}
?>

@ -38,8 +38,19 @@ add_action('wp_enqueue_scripts', 'enqueue_custom_gallery_assets');
function theme_enqueue_scripts() {
wp_enqueue_style('gp-front-page-materialize-css', get_template_directory_uri() . '/static/css/libs/materialize.min.css');
wp_enqueue_style('gp-front-page-style-2', get_template_directory_uri() . '/static/css/front-page.css');
wp_enqueue_style('gp-front-page-style', get_template_directory_uri() . '/static/css/new-front-page.css');
wp_enqueue_style(
'gp-front-page-style-2',
get_template_directory_uri() . '/static/css/front-page-style.css',
array(),
filemtime(get_template_directory() . '/static/css/front-page-style.css')
);
wp_enqueue_style(
'gp-front-page-style',
get_template_directory_uri() . '/static/css/new-front-page-style.css',
array(),
filemtime(get_template_directory() . '/static/css/new-front-page-style.css')
);
wp_enqueue_script('gp-front-page-materialize', get_template_directory_uri() . '/static/js/libs/materialize.min.js', array(), null, true);
wp_enqueue_script('gp-front-page-main', get_template_directory_uri() . '/static/js/new-front-page.js', array(), null, true);
}

@ -2387,7 +2387,7 @@ background: #e5f1fa;
.about_slider .slide_title{
text-transform: uppercase;
font-size: 24px;
font-weight: 900;
font-weight: 900 !important;
line-height: 28.8px;
color: var(--grey-black, #121212);
}
@ -3152,16 +3152,16 @@ position: absolute;
gap: 12px;
}
.about_slider .carousel .carousel-item {
#about .about_slider .carousel .carousel-item {
padding: 10px 39px;
width: 290px;
height: 290px;
border-radius: 100%;
border-radius: 100% !important;
}
.about_slider .carousel .carousel-item::after {
background-image: url(../img/border-mobile.png);
border-radius: 100%;
border-radius: 100% !important;
}
.about_slider .prev {
@ -3897,31 +3897,31 @@ background-color: #fff;
@media (max-width: 576px) {
.about_slider .slide {
padding: 10px 39px;
width: 280px;
height: 280px;
border-radius: 100%;
gap: 12px;
padding: 10px 39px !important;
width: 280px!important;
height: 280px!important;
border-radius: 100% !important;
gap: 12px!important;
}
.about_slider .carousel .carousel-item {
padding: 10px 39px;
width: 290px;
height: 290px;
border-radius: 100%;
padding: 10px 39px !important;
width: 290px!important;
height: 290px!important;
border-radius: 100% !important;
}
.about_slider .carousel .carousel-item::after {
background-image: url(../img/border-mobile.png);
border-radius: 100%;
border-radius: 100% !important;
}
.about_slider .prev {
left: 10vw;
left: 10vw!important;
}
.about_slider .next {
right: 10vw;
right: 10vw!important;
}
.about_slider .slide.active {
@ -3929,8 +3929,8 @@ background-color: #fff;
}
.about_slider .slide img {
width: 113px;
height: 113px;
width: 113px !important;
height: 113px !important;
}
.about_slider .slide_info {
@ -3939,8 +3939,8 @@ background-color: #fff;
.about_slider .slide_text,
.about_slider .slide_title {
font-size: 12px;
line-height: 14.4px;
font-size: 12px !important;
line-height: 14.4px !important;
text-align: center;
}
.truth_end-text{
@ -4021,14 +4021,14 @@ width: max-content;
@media (max-width: 576px) {
.main-food_reviews {
min-height: 600px;
min-height: 720px;
height: 80vh;
max-height: 750px;
max-height: 850px;
}
.main-food_reviews-slide {
min-height: 520px;
min-height: 640px;
height: calc(80vh - 80px);
max-height: 670px;
max-height: 770px;
}
.main-bot .swiper-pagination-bullet{
width: 91px;
@ -4119,3 +4119,10 @@ bottom: 8rem !important;
padding-top: 2rem;
}
}
.mform__review__media{
display: block;
width: 100%;
max-width: 350px;
}

@ -171,6 +171,46 @@ function get_collection_siblings($term) {
add_filter( 'woocommerce_price_trim_zeros', '__return_true' );
// Функция для округления цен с учетом налога
function round_price_with_tax($price) {
return round($price);
}
// Функция для получения цены товара с учетом налога и округления
function get_product_price_with_tax($product) {
if (!$product) return 0;
$price = $product->get_price();
$tax_rate = 0;
// Получаем ставку налога для товара
$tax_rates = WC_Tax::get_rates($product->get_tax_class());
if (!empty($tax_rates)) {
$tax_rate = array_values($tax_rates)[0]['rate'] ?? 0;
}
// Вычисляем цену с налогом
$price_with_tax = $price * (1 + $tax_rate / 100);
return round_price_with_tax($price_with_tax);
}
// Функция для получения общей суммы корзины с учетом налога и округления
function get_cart_total_with_tax() {
if (!WC()->cart) return 0;
$total = WC()->cart->get_total('edit');
return round_price_with_tax($total);
}
// Функция для получения стоимости доставки с учетом налога и округления
function get_shipping_total_with_tax() {
if (!WC()->cart) return 0;
$shipping_total = WC()->cart->get_shipping_total();
return round_price_with_tax($shipping_total);
}
// Добавление поля для выбора рекомендуемых товаров
function register_recommended_products_acf_field() {

@ -22,7 +22,7 @@
<div class="block_title">{{text}}</div>
</div>
<h2 class="section_title2" id="about">{{ adv_title }}</h2>
<p class="description">Due to the unique structure of the entoprotein, it is unlikely to cause allergies. Additionally, since animals have not encountered this type of protein during evolution, it does not trigger allergic reactions in pets.</p>
<p class="description">{{adv_text}}</p>
<div class="advantage_row">
{% for item in adv %}
<div class="advantage_item">

@ -25,11 +25,8 @@
{% for item in desc %}
<p class="steps_desc{% if item.small_text %}--min{% endif %}">{{ item.text }}</p>
{% endfor %}
{% if site_region == 'ru' %}
<p class="steps_desc">COSMOPET PRODUCTION IS BASED ON A UNIQUE TECHNOLOGICAL PROCESS WHICH HAS NO ANALOGUES IN THE WORLD.</p>
{% endif %}
</div>
<div class="steps_title">{{ function('pll_e', 'PRODUCTION STAGES') }}</div>
<div class="steps_title">{{ function('pll_e', 'ЭТАПЫ ПРОИЗВОДСТВА') }}</div>
<div class="production_steps_row">
{% if steps_1[0] is defined %}
@ -181,7 +178,7 @@
<section class="feed_production">
<div class="container">
<div class="section_title">{{ function('pll_e', 'Stages of feed production') }}</div>
<div class="section_title">{{ function('pll_e', 'Этапы производства корма') }}</div>
<div class="feed_steps__row">
{% for item in steps_2 %}

@ -57,7 +57,7 @@
</button>
{% for reply in comment.replies %}
{% include 'partials/comment.twig' with { comment: reply, depth: depth + 1 } %}
{% include 'blog/comments/comment-single.twig' with { comment: reply, depth: depth + 1 } %}
{% endfor %}
{% endif %}
</div>

@ -1,12 +1,14 @@
<!DOCTYPE html>
<html lang="ru">
<head>
{{ function('wp_head') }}
<title>{{ function('wp_title') }} </title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% if site_mode == 'production' %}
{{ header_scripts }}
{% endif %}

@ -4,7 +4,7 @@
<div class="mform__review">
<div class="close-button">&times;</div>
{% if fn('get_field', 'media_file', slide) %}
<a href="{{fn('get_field', 'media_file', slide)}}" data-fancybox><img class="main-food_reviews-slide-media_file" src="{{fn('get_field', 'media_file', slide)}}"></a>
<a href="{{fn('get_field', 'media_file', slide)}}" class="mform__review__media" data-fancybox><img class="main-food_reviews-slide-media_file" src="{{fn('get_field', 'media_file', slide)}}"></a>
{% endif %}
{% if fn('get_field', 'media', slide) %}
<div class="main-food_reviews-slide-media_wrap">

@ -26,8 +26,10 @@
{% if not chosen_shipping_methods[0] is defined %}
<td class="order-your-calculation__description">{{ fn('pll_e', 'Введите адрес доставки') }}</td>
{% else %}
<td class="order-your-calculation__value order-your-calculation__value--price">{{ fn('WC').cart.get_shipping_total() }} ₽</td>
<td class="order-your-calculation__value order-your-calculation__value--price">{{ (fn('WC').cart.get_shipping_total() + fn('WC').cart.get_shipping_tax())|round }} ₽</td>
{% endif %}
</tr>
{% for fee in fn('WC').cart.get_fees() %}

@ -93,9 +93,13 @@ $calculator_text = '';
</div>
<div class="modal-map-control-item__description">
<p class="modal-map-control-item__time"><?php echo $text_in_parentheses; ?></p>
<p class="modal-map-control-item__price"> <?php
echo $method->cost;
?>₽</p>
<p class="modal-map-control-item__price">
<?php
$tax_total = array_sum($method->get_taxes());
echo round($method->cost + $tax_total);
echo get_woocommerce_currency_symbol();
?>
</p>
</div>
<?php do_action( 'woocommerce_after_shipping_rate', $method, $index ); ?>
</div>

@ -62,7 +62,9 @@ defined( 'ABSPATH' ) || exit;
<?php
else:
?>
<td class="order-your-calculation__value order-your-calculation__value--price"><?php echo WC()->cart->get_shipping_total(); ?></td>
<td class="order-your-calculation__value order-your-calculation__value--price"><?php echo WC()->cart->get_shipping_total() + WC()->cart->get_shipping_tax() ?> <?php echo get_woocommerce_currency_symbol(); ?></td>
<?php endif; ?>
</tr>

Loading…
Cancel
Save