From 214380a4e56214179b2bc792ff58f53c1c3abee5 Mon Sep 17 00:00:00 2001 From: "Anton.AE" Date: Sat, 4 Apr 2026 20:35:13 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20checkout?= =?UTF-8?q?=20cart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/css/test1-shared-shell.css | 227 ++++++++++++++++++ .../themes/twentytwentyfour/functions.php | 77 ++++++ .../themes/twentytwentyfour/page-cart.php | 74 +----- .../themes/twentytwentyfour/page-checkout.php | 58 +---- 4 files changed, 328 insertions(+), 108 deletions(-) create mode 100644 wp-content/themes/twentytwentyfour/assets/css/test1-shared-shell.css diff --git a/wp-content/themes/twentytwentyfour/assets/css/test1-shared-shell.css b/wp-content/themes/twentytwentyfour/assets/css/test1-shared-shell.css new file mode 100644 index 00000000..1f2c2f3d --- /dev/null +++ b/wp-content/themes/twentytwentyfour/assets/css/test1-shared-shell.css @@ -0,0 +1,227 @@ +.test1-shared-shell { + font-family: "Manrope", sans-serif; +} + +.test1-shared-shell .container { + width: min(1180px, calc(100% - 32px)); + margin: 0 auto; +} + +.test1-shared-shell .site-main { + padding-top: 20px; +} + +.test1-shared-shell .site-header { + position: sticky; + top: 0; + z-index: 40; + backdrop-filter: blur(16px); + background: rgba(244, 248, 255, 0.9); + border-bottom: 1px solid rgba(18, 48, 89, 0.08); +} + +.test1-shared-shell .header-row { + display: flex; + align-items: center; + justify-content: space-between; + gap: 20px; + min-height: 82px; +} + +.test1-shared-shell .brand { + display: flex; + align-items: center; + gap: 14px; + color: #123059; + text-decoration: none; +} + +.test1-shared-shell .brand-mark { + width: 48px; + height: 48px; + display: grid; + place-items: center; + border-radius: 18px; + background: linear-gradient(145deg, #3cc8ff, #0d4fd6); + color: #fff; + box-shadow: 0 14px 28px rgba(13, 79, 214, 0.24); +} + +.test1-shared-shell .brand-text strong { + display: block; + font-size: 16px; + line-height: 1.2; +} + +.test1-shared-shell .brand-text span { + color: #5f7496; + font-size: 12px; +} + +.test1-shared-shell .nav { + display: flex; + align-items: center; + gap: 20px; +} + +.test1-shared-shell .nav a { + color: #5f7496; + text-decoration: none; + font-size: 14px; + font-weight: 700; +} + +.test1-shared-shell .nav a:hover, +.test1-shared-shell .nav a:focus-visible { + color: #08338d; +} + +.test1-shared-shell .header-actions { + display: flex; + align-items: center; + gap: 12px; +} + +.test1-shared-shell .header-phone, +.test1-shared-shell .cart-button, +.test1-shared-shell .checkout-back-link { + display: inline-flex; + align-items: center; + justify-content: center; + min-height: 46px; + padding: 10px 18px; + border-radius: 999px; + text-decoration: none; + font-weight: 800; +} + +.test1-shared-shell .header-phone { + color: #123059; + background: rgba(255, 255, 255, 0.82); + border: 1px solid rgba(18, 48, 89, 0.1); +} + +.test1-shared-shell .cart-button, +.test1-shared-shell .checkout-back-link { + color: #fff; + background: linear-gradient(135deg, #08338d, #0d4fd6); + box-shadow: 0 14px 28px rgba(13, 79, 214, 0.24); +} + +.test1-shared-shell .classic-footer { + width: 100%; + margin-top: 24px; + padding: 44px 0 28px; + background: #0a1f47; + border-top: 1px solid rgba(255, 255, 255, 0.16); +} + +.test1-shared-shell .classic-footer-shell { + display: grid; + gap: 22px; +} + +.test1-shared-shell .classic-footer-main { + display: grid; + grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(180px, 1fr)); + gap: 28px; + align-items: start; +} + +.test1-shared-shell .classic-footer-col h3 { + margin: 0; + color: #fff; + font-size: 18px; + line-height: 1.2; +} + +.test1-shared-shell .footer-description, +.test1-shared-shell .footer-links a, +.test1-shared-shell .footer-legal a, +.test1-shared-shell .footer-bottom, +.test1-shared-shell .classic-footer .brand-text strong, +.test1-shared-shell .classic-footer .brand-text span { + color: rgba(255, 255, 255, 0.78); +} + +.test1-shared-shell .footer-links, +.test1-shared-shell .footer-legal { + display: grid; + gap: 10px; + margin-top: 14px; +} + +.test1-shared-shell .footer-links a, +.test1-shared-shell .footer-legal a { + text-decoration: none; +} + +.test1-shared-shell .footer-links a:hover, +.test1-shared-shell .footer-links a:focus-visible, +.test1-shared-shell .footer-legal a:hover, +.test1-shared-shell .footer-legal a:focus-visible { + color: #fff; +} + +.test1-shared-shell .classic-footer-bottom { + display: flex; + justify-content: space-between; + gap: 20px; + align-items: center; + margin-top: 8px; + padding-top: 16px; + border-top: 1px solid rgba(255, 255, 255, 0.16); + font-size: 13px; +} + +@media (max-width: 960px) { + .test1-shared-shell .nav { + display: none; + } + + .test1-shared-shell .header-row { + min-height: 74px; + } + + .test1-shared-shell .classic-footer-main { + grid-template-columns: 1fr 1fr; + } + + .test1-shared-shell .classic-footer-main .brand-col { + grid-column: 1 / -1; + } +} + +@media (max-width: 700px) { + .test1-shared-shell .container { + width: min(1180px, calc(100% - 20px)); + } + + .test1-shared-shell .header-actions { + gap: 8px; + } + + .test1-shared-shell .header-phone { + display: none; + } + + .test1-shared-shell .cart-button, + .test1-shared-shell .checkout-back-link { + min-height: 42px; + padding: 8px 14px; + } + + .test1-shared-shell .classic-footer { + padding-top: 32px; + } + + .test1-shared-shell .classic-footer-main, + .test1-shared-shell .classic-footer-bottom { + grid-template-columns: 1fr; + display: grid; + } + + .test1-shared-shell .classic-footer-main .brand-col { + grid-column: auto; + } +} diff --git a/wp-content/themes/twentytwentyfour/functions.php b/wp-content/themes/twentytwentyfour/functions.php index cc9c100f..d05f8bbd 100644 --- a/wp-content/themes/twentytwentyfour/functions.php +++ b/wp-content/themes/twentytwentyfour/functions.php @@ -228,6 +228,52 @@ function twentytwentyfour_test1_template( $template ) { } add_filter( 'template_include', 'twentytwentyfour_test1_template' ); +/** + * Use a lightweight custom template for the WooCommerce checkout page. + * + * @since Twenty Twenty-Four 1.0 + * + * @param string $template Resolved template path. + * @return string + */ +function twentytwentyfour_checkout_template( $template ) { + if ( ! function_exists( 'is_checkout' ) || ! is_checkout() || is_order_received_page() ) { + return $template; + } + + $custom_template = get_theme_file_path( 'page-checkout.php' ); + + if ( file_exists( $custom_template ) ) { + return $custom_template; + } + + return $template; +} +add_filter( 'template_include', 'twentytwentyfour_checkout_template', 20 ); + +/** + * Use a lightweight custom template for the WooCommerce cart page. + * + * @since Twenty Twenty-Four 1.0 + * + * @param string $template Resolved template path. + * @return string + */ +function twentytwentyfour_cart_template( $template ) { + if ( ! function_exists( 'is_cart' ) || ! is_cart() ) { + return $template; + } + + $custom_template = get_theme_file_path( 'page-cart.php' ); + + if ( file_exists( $custom_template ) ) { + return $custom_template; + } + + return $template; +} +add_filter( 'template_include', 'twentytwentyfour_cart_template', 20 ); + /** * Enqueue standalone landing assets for the page slug "test1". * @@ -292,6 +338,37 @@ function twentytwentyfour_test1_assets() { } add_action( 'wp_enqueue_scripts', 'twentytwentyfour_test1_assets', 100 ); +/** + * Enqueue shared test1 header/footer styles for cart and checkout. + * + * @since Twenty Twenty-Four 1.0 + * @return void + */ +function twentytwentyfour_test1_shared_shell_assets() { + if ( ! ( ( function_exists( 'is_checkout' ) && is_checkout() && ! is_order_received_page() ) || ( function_exists( 'is_cart' ) && is_cart() ) ) ) { + return; + } + + $shared_shell_css = get_theme_file_path( 'assets/css/test1-shared-shell.css' ); + + wp_enqueue_style( + 'twentytwentyfour-test1-fonts', + 'https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&display=swap', + array(), + null + ); + + if ( file_exists( $shared_shell_css ) ) { + wp_enqueue_style( + 'twentytwentyfour-test1-shared-shell-style', + get_theme_file_uri( 'assets/css/test1-shared-shell.css' ), + array( 'twentytwentyfour-test1-fonts' ), + (string) filemtime( $shared_shell_css ) + ); + } +} +add_action( 'wp_enqueue_scripts', 'twentytwentyfour_test1_shared_shell_assets', 110 ); + /** * Free shipping threshold for custom notices. * diff --git a/wp-content/themes/twentytwentyfour/page-cart.php b/wp-content/themes/twentytwentyfour/page-cart.php index aeba7b7f..bbfa166d 100644 --- a/wp-content/themes/twentytwentyfour/page-cart.php +++ b/wp-content/themes/twentytwentyfour/page-cart.php @@ -1,9 +1,8 @@ @@ -13,73 +12,24 @@ -> +> -
-
-
-
- - - -
-
- -

-

- -
- -
- - -
- -
- - -
- -
-
-
-
-
-
+
+
+ diff --git a/wp-content/themes/twentytwentyfour/page-checkout.php b/wp-content/themes/twentytwentyfour/page-checkout.php index 77cd4c46..4490eb8a 100644 --- a/wp-content/themes/twentytwentyfour/page-checkout.php +++ b/wp-content/themes/twentytwentyfour/page-checkout.php @@ -1,9 +1,8 @@ @@ -13,57 +12,24 @@ -> +> -
-
-
-
- - - -
-
- -

-

- -
- - - - -
- -
- -
-
- -
-
-
-
-
-
-
-
-

-

-
-
+
+
+