parent
fa4ec3fa53
commit
9faa1f1fe6
@ -0,0 +1,16 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
// 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; |
||||||
|
}); |
||||||
|
|
Loading…
Reference in new issue