The WooCommerce integration comes as a separate package. Before you install it, make sure that you’ve installed the WooCommerce plugin.
You can then install the integration with Composer:
composer require mindkomm/timber-integration-woocommerce
Then make sure that you require the autoload file. If you install the integration as a dependency of your theme, then this would be in your functions.php:
// Load Composer dependencies
require_once 'vendor/autoload.php';
You can’t install the integration as a WordPress plugin.
After the installation, you need to initizalize the integration.
functions.php
add_filter( 'timber/integrations', function ( array $integrations ): array {
$integrations[] = new \Timber\Integrations\WooCommerce\WooCommerceIntegration();
return $integrations;
} );