2026-04-06

This commit is contained in:
gcch 2026-04-06 14:08:45 +02:00
commit 7baeb28fc1
36 changed files with 390 additions and 415 deletions

View file

@ -39,7 +39,10 @@ $products = wc_get_products([
assert(is_array($products), 'Les Produits de la Catégorie doivent être un tableau.');
return $products;
}
|> (static fn(/** @var list<WC_Product> */ array $products): array => Arr::map($products, Product::new(...)));
|> (static fn(/** @var list<WC_Product> */ array $products): array => Arr::map(
$products,
Product::from_wc_product(...),
));
$context['products'] = $products;
$context['category_id'] = $current_term->term_id;
@ -60,7 +63,4 @@ add_action('wp_enqueue_scripts', function (): void {
});
// Rendu
Timber::render(
filenames: $templates,
data: $context,
);
Timber::render(filenames: $templates, data: $context);