From 9faa1f1fe656411f91c3b28c5bc48c3865590ae7 Mon Sep 17 00:00:00 2001 From: maksim Date: Tue, 1 Jul 2025 18:57:37 +0300 Subject: [PATCH] =?UTF-8?q?Task=207035=20|=20=D1=80=D0=B5=D1=84=D0=B0?= =?UTF-8?q?=D0=BA=D1=82=D0=BE=D1=80=D0=B8=D0=BD=D0=B3=20=D0=BA=D0=BE=D0=BD?= =?UTF-8?q?=D1=82=D1=80=D0=BE=D0=BB=D0=BB=D0=B5=D1=80=D0=B0=20=D1=87=D0=B5?= =?UTF-8?q?=D0=BA=D0=B0=D1=83=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/checkout/component-controller.php | 16 ++++++++++++++++ .../woocommerce/checkout/form-checkout.php | 15 --------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/wp-content/themes/cosmopet/modules/shop/components/checkout/component-controller.php b/wp-content/themes/cosmopet/modules/shop/components/checkout/component-controller.php index e69de29..312d3a8 100644 --- a/wp-content/themes/cosmopet/modules/shop/components/checkout/component-controller.php +++ b/wp-content/themes/cosmopet/modules/shop/components/checkout/component-controller.php @@ -0,0 +1,16 @@ +checkout(); + +// In your theme's functions.php +add_filter('timber/twig', function($twig) { + $twig->addFunction(new \Twig\TwigFunction('WC', function() { + return WC(); + })); + return $twig; +}); + diff --git a/wp-content/themes/cosmopet/woocommerce/checkout/form-checkout.php b/wp-content/themes/cosmopet/woocommerce/checkout/form-checkout.php index d259c1d..7a433b1 100644 --- a/wp-content/themes/cosmopet/woocommerce/checkout/form-checkout.php +++ b/wp-content/themes/cosmopet/woocommerce/checkout/form-checkout.php @@ -11,19 +11,4 @@ if (!defined('ABSPATH')) { exit; } -// Get Timber context -$context = Timber::context(); - -// Add WooCommerce-specific data to context -$context['checkout'] = WC()->checkout(); - -// In your theme's functions.php -add_filter('timber/twig', function($twig) { - $twig->addFunction(new \Twig\TwigFunction('WC', function() { - return WC(); - })); - return $twig; -}); - -// Render the Twig template Timber::render('shop/checkout.twig', $context); \ No newline at end of file