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