2026-04-06
This commit is contained in:
parent
2971f5516d
commit
7baeb28fc1
36 changed files with 390 additions and 415 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue