2024-09-30
This commit is contained in:
parent
ad2981ba77
commit
ff27cdf9a5
48 changed files with 159 additions and 63 deletions
26
web/app/themes/haiku-atelier-2024/archive-product.php
Normal file
26
web/app/themes/haiku-atelier-2024/archive-product.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
/**
|
||||
* Le modèle de la Page Boutique (« E-Shop »).
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Timber\Timber;
|
||||
|
||||
require_once __DIR__ . "/src/inc/TraitementInformations.php";
|
||||
|
||||
// Contexte et modèles
|
||||
$contexte = Timber::context();
|
||||
$modeles = ["boutique.twig"];
|
||||
|
||||
// Informations brutes des Produits
|
||||
$informations_produits = wc_get_products([
|
||||
"orderby" => "date",
|
||||
"order" => "DESC",
|
||||
]);
|
||||
// Informations nécessaires pour la grille des Produits
|
||||
$produits = array_map($callback = "recupere_informations_produit_shop", $array = $informations_produits);
|
||||
$contexte["produits"] = $produits;
|
||||
|
||||
// Rendu
|
||||
Timber::render($filenames = $modeles, $data = $contexte);
|
||||
Loading…
Add table
Add a link
Reference in a new issue