From 50d6fe60ed33218616451e6b38a7628cb90a6d06 Mon Sep 17 00:00:00 2001 From: "Anton.AE" Date: Wed, 1 Apr 2026 23:50:24 +0300 Subject: [PATCH] =?UTF-8?q?Anton=20|=20=D0=BD=D0=B0=D1=82=D1=8F=D0=B6?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B1=D0=BB=D0=BE=D0=BA=D0=B0=20=D1=82=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D1=80=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../themes/twentytwentyfour/page-test1.php | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) diff --git a/wp-content/themes/twentytwentyfour/page-test1.php b/wp-content/themes/twentytwentyfour/page-test1.php index 807284ec..89e0e763 100644 --- a/wp-content/themes/twentytwentyfour/page-test1.php +++ b/wp-content/themes/twentytwentyfour/page-test1.php @@ -6,8 +6,155 @@ * @since Twenty Twenty-Four 1.0 */ +/** + * Build the catalog markup from WooCommerce products. + * + * @return string + */ +function twentytwentyfour_test1_catalog_markup() { + if ( ! class_exists( 'WooCommerce' ) ) { + return ''; + } + + $products = wc_get_products( + array( + 'status' => 'publish', + 'limit' => 3, + 'order' => 'ASC', + 'orderby'=> 'date', + ) + ); + + if ( empty( $products ) ) { + return ''; + } + + ob_start(); + ?> +
+ $product ) : ?> + get_image_id(); + $image_html = $image_id ? wp_get_attachment_image( $image_id, 'medium', false, array( 'class' => 'catalog-product-image' ) ) : ''; + $short_text = $product->get_short_description(); + if ( '' === trim( wp_strip_all_tags( $short_text ) ) ) { + $short_text = $product->get_description(); + } + $short_text = wp_trim_words( wp_strip_all_tags( $short_text ), 22, '...' ); + $price = wp_strip_all_tags( $product->get_price_html() ); + $volume = $product->get_attribute( 'volume' ); + if ( '' === $volume ) { + $volume = $product->get_attribute( 'pa_volume' ); + } + if ( '' === $volume ) { + $volume = __( 'Товар', 'twentytwentyfour' ); + } + ?> +
+ +
+ + + +

get_name() ); ?>

+

+
+ + is_in_stock() ) : ?> + + +
+
+ +
+ +
+ +
+ +

Вода 19 литров

+

Главный формат для кулеров, кухни и офиса. Самая выгодная цена за литр и удобная возвратная тара.

+
+ хит продаж + для кулера +
+
290 ₽за бутыль
+ +
+ +
+ +

Вода 5 литров

+

Удобный домашний формат для кухни, поездок и дачи. Легко хранить, просто переносить.

+
+ домой + компактно +
+
95 ₽за бутылку
+ +
+ +
+ +

0.5 / 1.5 литра

+

Для тренировок, поездок, мероприятий и ежедневного запаса питьевой воды дома или на работе.

+
+ спорт + мероприятия +
+
39 ₽от 0.5 л
+ +
+ +
+ +

Минеральная вода

+

Освежающий вариант для гостей, кафе и тех, кто предпочитает яркий минеральный вкус.

+
+ для кафе + рестораны +
+
68 ₽за 1.5 л
+ +
+ +
+ +

Газированная / негазированная

+

Соберите микс под привычки семьи или офиса: мягкая вода на каждый день и газированная к столу.

+
+ микс заказ + на выбор +
+
45 ₽за 0.5 л
+ +
+ +HTML; + + $landing_html = str_replace( $catalog_static_markup, $catalog_markup, $landing_html ); + } +} ?> >