*/
+ $targets = ['full', 'thumbnail'];
+
+ foreach ($sizes as $size_index => $size) {
+ if (!in_array($size, $targets, true)) {
+ unset($sizes[$size_index]);
+ }
}
- }
- return $sizes;
+ return $sizes;
}
-add_filter("intermediate_image_sizes", "retire_tailles_image_par_defaut", 10, 1);
-add_filter("big_image_size_threshold", "__return_false");
+
+add_filter('intermediate_image_sizes', 'retire_tailles_image_par_defaut', 10, 1);
+add_filter('big_image_size_threshold', '__return_false');
// Désactive la mise à jour automatique des traductions
-add_filter("async_update_translation", "__return_false");
-add_filter("auto_update_translation", "__return_false");
+add_filter('async_update_translation', '__return_false');
+add_filter('auto_update_translation', '__return_false');
// Block Patterns
-add_action("after_setup_theme", function () {
- remove_theme_support("core-block-patterns");
+add_action('after_setup_theme', function () {
+ remove_theme_support('core-block-patterns');
});
-add_filter("should_load_remote_block_patterns", "__return_false");
+add_filter('should_load_remote_block_patterns', '__return_false');
/**
- * WooCommerce
+ * WooCommerce.
*/
// Charge Carbon Fields
function charge_carbon_fields(): void {
- // Nécessaire pour que Carbon Fields trouve ses ressources
- define("Carbon_Fields\URL", home_url("/vendor/htmlburger/carbon-fields"));
- Carbon_Fields::boot();
+ // Nécessaire pour que Carbon Fields trouve ses ressources
+ define('Carbon_Fields\URL', home_url('/vendor/htmlburger/carbon-fields'));
+ Carbon_Fields::boot();
}
-add_action("after_setup_theme", "charge_carbon_fields");
+
+add_action('after_setup_theme', 'charge_carbon_fields');
// Emails
// add_filter("woocommerce_email_styles", "patricks_woocommerce_email_styles");
diff --git a/web/app/themes/haiku-atelier-2024/index.php b/web/app/themes/haiku-atelier-2024/index.php
index f388f30b..d398f530 100755
--- a/web/app/themes/haiku-atelier-2024/index.php
+++ b/web/app/themes/haiku-atelier-2024/index.php
@@ -5,6 +5,6 @@ declare(strict_types=1);
use Timber\Timber;
$contexte = Timber::context();
-$modeles = ["base.twig"];
+$modeles = ['base.twig'];
Timber::render($filenames = $modeles, $data = $contexte);
diff --git a/web/app/themes/haiku-atelier-2024/page-about.php b/web/app/themes/haiku-atelier-2024/page-about.php
index f98959c5..1c88fb6d 100755
--- a/web/app/themes/haiku-atelier-2024/page-about.php
+++ b/web/app/themes/haiku-atelier-2024/page-about.php
@@ -1,4 +1,5 @@
cart->get_subtotal();
-/** @var string|null $code_promo Le code promo appliqué au Panier s'il existe. */
+
+/** @var null|string $code_promo Le code promo appliqué au Panier s'il existe. */
$code_promo = collect(WC()->cart->get_applied_coupons())->first();
+
/** @var int $sous_total_reduction Le total du montant de la Réduction appliquée au Panier */
-$sous_total_reduction = Number::format(WC()->cart->get_totals()["discount_total"], maxPrecision: 2);
+$sous_total_reduction = Number::format(WC()->cart->get_totals()['discount_total'], maxPrecision: 2);
+
/** @var float $total_panier Le total de la Commande dans le Panier. */
-$total_panier = Number::format(floatval(WC()->cart->get_totals()["total"]), maxPrecision: 2);
+$total_panier = Number::format(floatval(WC()->cart->get_totals()['total']), maxPrecision: 2);
foreach (WC()->cart->get_cart() as $cle_panier => $article_panier) {
- $panier[$cle_panier] = [
- "attributs" =>
- $article_panier["data"]?->get_type() == "variation"
- ? recupere_et_formate_attributs_produit($article_panier["data"]?->get_attributes())
- : [],
- "cle" => $cle_panier,
- "id_produit" => $article_panier["product_id"],
- "id_variation" => $article_panier["variation_id"],
- "image" => pipe(
- $article_panier["data"]?->get_image_id(),
- fn($id) => genere_balise_img_multiformats(id: $id, lazy: true),
- ),
- "prix" => $article_panier["data"]?->get_price(),
- "quantite" => $article_panier["quantity"],
- "url" => $article_panier["data"]?->get_permalink(),
- "titre" => $article_panier["data"]?->get_title(),
- ];
+ $panier[$cle_panier] = [
+ 'attributs' => $article_panier['data']?->get_type() == 'variation'
+ ? recupere_et_formate_attributs_produit($article_panier['data']?->get_attributes())
+ : [],
+ 'cle' => $cle_panier,
+ 'id_produit' => $article_panier['product_id'],
+ 'id_variation' => $article_panier['variation_id'],
+ 'image' => pipe($article_panier['data']?->get_image_id(), fn($id) => genere_balise_img_multiformats(
+ id: $id,
+ lazy: true,
+ )),
+ 'prix' => $article_panier['data']?->get_price(),
+ 'quantite' => $article_panier['quantity'],
+ 'url' => $article_panier['data']?->get_permalink(),
+ 'titre' => $article_panier['data']?->get_title(),
+ ];
}
// Récupère les Adresses de l'Utilisateur
$email = WC()->customer->get_billing_email();
$adresse_livraison = WC()->customer->get_shipping();
$adresse_facturation = WC()->customer->get_billing();
-$adresse_renseignee = $adresse_livraison["city"] != "";
-$pays_livraison = collect(WC()->countries->get_countries())
- ->only($pays_acceptes)
- ->toArray();
-$total_livraison = Number::format(floatval(WC()->cart->get_totals()["shipping_total"]), precision: 0);
-$methodes_livraison = collect(WC()->session->get("shipping_for_package_0")["rates"])
- ->values()
- ->map(function (WC_Shipping_Rate $methode) {
- return [
- "id" => $methode->get_method_id(),
- "prix" => Number::format(intval($methode->get_cost()), maxPrecision: 2),
- "selectionnee" => collect(WC()->session->get("chosen_shipping_methods"))->first() == $methode->get_id(),
- "titre" => $methode->get_label(),
- ];
- });
+$adresse_renseignee = $adresse_livraison['city'] != '';
+$pays_livraison = collect(WC()->countries->get_countries())->only($pays_acceptes)->toArray();
+$total_livraison = Number::format(floatval(WC()->cart->get_totals()['shipping_total']), precision: 0);
+$methodes_livraison = collect(WC()->session->get('shipping_for_package_0')['rates'])
+ ->values()
+ ->map(fn(WC_Shipping_Rate $methode) => [
+ 'id' => $methode->get_method_id(),
+ 'prix' => Number::format(intval($methode->get_cost()), maxPrecision: 2),
+ 'selectionnee' => collect(WC()->session->get('chosen_shipping_methods'))->first() == $methode->get_id(),
+ 'titre' => $methode->get_label(),
+ ]);
-$contexte["email"] = $email;
-$contexte["adresse_livraison"] = $adresse_livraison;
-$contexte["adresse_facturation"] = $adresse_facturation;
-$contexte["adresse_renseignee"] = $adresse_renseignee;
-$contexte["sous_total_panier"] = $sous_total_panier;
-$contexte["code_promo"] = $code_promo;
-$contexte["sous_total_reduction"] = $sous_total_reduction;
-$contexte["total_panier"] = $total_panier;
-$contexte["produits_panier"] = $panier;
-$contexte["pays_livraison"] = $pays_livraison;
-$contexte["sous_total_livraison"] = $total_livraison;
-$contexte["methodes_livraison"] = $methodes_livraison;
+$contexte['email'] = $email;
+$contexte['adresse_livraison'] = $adresse_livraison;
+$contexte['adresse_facturation'] = $adresse_facturation;
+$contexte['adresse_renseignee'] = $adresse_renseignee;
+$contexte['sous_total_panier'] = $sous_total_panier;
+$contexte['code_promo'] = $code_promo;
+$contexte['sous_total_reduction'] = $sous_total_reduction;
+$contexte['total_panier'] = $total_panier;
+$contexte['produits_panier'] = $panier;
+$contexte['pays_livraison'] = $pays_livraison;
+$contexte['sous_total_livraison'] = $total_livraison;
+$contexte['methodes_livraison'] = $methodes_livraison;
// echo "";
// print_r($adresse_livraison);
@@ -161,21 +162,25 @@ $contexte["methodes_livraison"] = $methodes_livraison;
// Charge les scripts et styles de la page
function charge_scripts_styles_page_panier(): void {
- wp_enqueue_style(
- handle: "haiku-atelier-2024-styles-page-panier",
- src: get_template_directory_uri() . "/assets/css/pages/page-panier.css",
- deps: [],
- ver: filemtime(get_template_directory() . "/assets/css/pages/page-panier.css"),
- media: "all",
- );
- wp_enqueue_script_module(
- id: "haiku-atelier-2024-scripts-page-panier",
- src: get_template_directory_uri() . "/assets/js/scripts-page-panier.js",
- deps: [],
- version: filemtime(get_template_directory() . "/assets/js/scripts-page-panier.js"),
- );
+ wp_enqueue_style(
+ handle: 'haiku-atelier-2024-styles-page-panier',
+ src: get_template_directory_uri() . '/assets/css/pages/page-panier.css',
+ deps: [],
+ ver: filemtime(get_template_directory() . '/assets/css/pages/page-panier.css'),
+ media: 'all',
+ );
+ wp_enqueue_script_module(
+ id: 'haiku-atelier-2024-scripts-page-panier',
+ src: get_template_directory_uri() . '/assets/js/scripts-page-panier.js',
+ deps: [],
+ version: filemtime(get_template_directory() . '/assets/js/scripts-page-panier.js'),
+ );
}
-add_action("wp_enqueue_scripts", "charge_scripts_styles_page_panier");
+
+add_action('wp_enqueue_scripts', 'charge_scripts_styles_page_panier');
// Rendu
-Timber::render(filenames: $modeles, data: $contexte);
+Timber::render(
+ filenames: $modeles,
+ data: $contexte,
+);
diff --git a/web/app/themes/haiku-atelier-2024/page-checkout.php b/web/app/themes/haiku-atelier-2024/page-checkout.php
index 08c07ccb..9a82eee8 100755
--- a/web/app/themes/haiku-atelier-2024/page-checkout.php
+++ b/web/app/themes/haiku-atelier-2024/page-checkout.php
@@ -1,6 +1,7 @@
session;
+
/** @var array $urls URLs utilisables pour rediriger l'Utilisateur. */
$urls = [
- "accueil" => get_page_link(get_page_by_path("home")),
- "succes_commande" => get_page_link(get_page_by_path("successful-order")),
- "echec_commande" => get_page_link(get_page_by_path("failed-order")),
+ 'accueil' => get_page_link(get_page_by_path('home')),
+ 'succes_commande' => get_page_link(get_page_by_path('successful-order')),
+ 'echec_commande' => get_page_link(get_page_by_path('failed-order')),
];
// Redirige à la page d'accueil si le Panier est vide
if (WC()->cart->is_empty()) {
- header("Location: " . $urls["accueil"]);
- return;
+ header('Location: ' . $urls['accueil']);
+
+ return;
}
// Vérifie que les paramètres d'URLs nécessaires soient présents
/** @var string $order_id */
-$order_id = $_GET["order_id"];
+$order_id = $_GET['order_id'];
if (!$order_id) {
- $reponse = ["succes" => false, "status" => "order_key is missing"];
- echo json_encode($reponse);
- http_response_code(400);
- return;
+ $reponse = ['succes' => false, 'status' => 'order_key is missing'];
+ echo json_encode($reponse);
+ http_response_code(400);
+
+ return;
}
+
/** @var string $order_key */
-$order_key = $_GET["order_key"];
+$order_key = $_GET['order_key'];
if (!$order_key) {
- $reponse = ["succes" => false, "status" => "order_key is missing"];
- echo json_encode($reponse);
- http_response_code(400);
- return;
+ $reponse = ['succes' => false, 'status' => 'order_key is missing'];
+ echo json_encode($reponse);
+ http_response_code(400);
+
+ return;
}
// Récupère le Panier et l'Email du Client
/** @var WC_Cart $panier */
$panier = WC()->cart;
-/** @var string $email_client */
-$email_client = WC()->session->get("customer")["email"];
-/** @var array<\Stripe\Product> $articles */
-$articles = collect($panier->get_cart())
- ->map(function ($article_panier) {
- $titre_produit = match ($article_panier["data"]?->get_type() == "variable") {
- true => $article_panier["data"]?->get_title() .
- " (" .
- explode(": ", $article_panier["data"]?->get_attribute_summary())[1] .
- ")",
- false => $article_panier["data"]?->get_title(),
- };
- return [
- "price_data" => [
- "currency" => "EUR",
- "product_data" => [
- "name" => $titre_produit,
- "images" => [wp_get_attachment_image_url($article_panier["data"]?->get_image_id())],
- ],
- "unit_amount" => $article_panier["data"]?->get_price() * 100,
- ],
- "quantity" => $article_panier["quantity"],
- ];
- })
- ->values()
- ->toArray();
+/** @var string $email_client */
+$email_client = WC()->session->get('customer')['email'];
+
+/** @var array $articles */
+$articles = collect($panier->get_cart())
+ ->map(function ($article_panier) {
+ $titre_produit = match ('variable' == $article_panier['data']?->get_type()) {
+ true => $article_panier['data']?->get_title()
+ . ' ('
+ . explode(': ', $article_panier['data']?->get_attribute_summary())[1]
+ . ')',
+ false => $article_panier['data']?->get_title(),
+ };
+
+ return [
+ 'price_data' => [
+ 'currency' => 'EUR',
+ 'product_data' => [
+ 'name' => $titre_produit,
+ 'images' => [wp_get_attachment_image_url($article_panier['data']?->get_image_id())],
+ ],
+ 'unit_amount' => $article_panier['data']?->get_price() * 100,
+ ],
+ 'quantity' => $article_panier['quantity'],
+ ];
+ })
+ ->values()
+ ->toArray();
// Récupère la Commande et la Méthode de Livraison
/** @var WC_Order $commande */
$commande = wc_get_order($order_id);
+
/** @var mixed $methode_livraison */
-$methode_livraison = [
- "nom" => $commande->get_shipping_method(),
- "cout" => $commande->get_shipping_total() * 100,
-];
+$methode_livraison = ['nom' => $commande->get_shipping_method(), 'cout' => $commande->get_shipping_total() * 100];
// Sélectionne la clé API Stripe
-\Stripe\Stripe::setApiKey(Config::get("STRIPE_API_SECRET"));
+Stripe::setApiKey(Config::get('STRIPE_API_SECRET'));
// Met à jour les Codes promos
-$coupons_stripe = collect(\Stripe\Coupon::all()->data);
+$coupons_stripe = collect(Coupon::all()->data);
$coupons_wc = collect(WC()->cart->get_coupons())
- ->map(
- fn(WC_Coupon $coupon) => [
- "duration" => "forever",
- "id" => $coupon->get_code(),
- "name" => $coupon->get_code(),
- $coupon->get_discount_type() == "fixed_cart" ? "amount_off" : "percent_off" => $coupon->get_amount(),
- ],
- )
- ->each(function (array $item) use ($coupons_stripe) {
- // Si le code promo n'existe, le créer
- if (!$coupons_stripe->contains("name", $item["name"])) {
- \Stripe\Coupon::create($item);
- }
- });
-$reductions_stripe = $coupons_wc->map(fn($coupon) => ["coupon" => $coupon["name"]])->values()->toArray();
+ ->map(fn(WC_Coupon $coupon) => [
+ 'duration' => 'forever',
+ 'id' => $coupon->get_code(),
+ 'name' => $coupon->get_code(),
+ 'fixed_cart' === $coupon->get_discount_type() ? 'amount_off' : 'percent_off' => $coupon->get_amount(),
+ ])
+ ->each(function (array $item) use ($coupons_stripe) {
+ // Si le code promo n'existe, le créer
+ if (!$coupons_stripe->contains('name', $item['name'])) {
+ Coupon::create($item);
+ }
+ });
+$reductions_stripe = $coupons_wc->map(fn($coupon) => ['coupon' => $coupon['name']])->values()->toArray();
+
/** @var Session $session_checkout_stripe */
-$session_checkout_stripe = \Stripe\Checkout\Session::create(
- [
- "cancel_url" => $urls["echec_commande"],
- "customer_email" => $email_client,
- "discounts" => $reductions_stripe,
- "line_items" => $articles,
- "mode" => "payment",
- "success_url" => $urls["succes_commande"] . "?session_id={CHECKOUT_SESSION_ID}",
- "metadata" => [
- "order_id" => $order_id,
- "order_key" => $order_key,
- ],
- "shipping_options" => [
- [
- "shipping_rate_data" => [
- "display_name" => $methode_livraison["nom"],
- "fixed_amount" => [
- "amount" => $methode_livraison["cout"],
- "currency" => "EUR",
- ],
- "tax_behavior" => "inclusive",
- "type" => "fixed_amount",
- ],
- ],
- ],
- ],
- [
- "idempotency_key" => Uuid::uuid4(),
- ],
-);
+$session_checkout_stripe = \Stripe\Checkout\Session::create([
+ 'cancel_url' => $urls['echec_commande'],
+ 'customer_email' => $email_client,
+ 'discounts' => $reductions_stripe,
+ 'line_items' => $articles,
+ 'mode' => 'payment',
+ 'success_url' => $urls['succes_commande'] . '?session_id={CHECKOUT_SESSION_ID}',
+ 'metadata' => ['order_id' => $order_id, 'order_key' => $order_key],
+ 'shipping_options' => [['shipping_rate_data' => [
+ 'display_name' => $methode_livraison['nom'],
+ 'fixed_amount' => ['amount' => $methode_livraison['cout'], 'currency' => 'EUR'],
+ 'tax_behavior' => 'inclusive',
+ 'type' => 'fixed_amount',
+ ]]],
+], ['idempotency_key' => Uuid::uuid4()]);
// echo json_encode($session_checkout_stripe);
-header("HTTP/1.1 303 See Other");
-header("Location: " . $session_checkout_stripe->url);
+header('HTTP/1.1 303 See Other');
+header('Location: ' . $session_checkout_stripe->url);
exit();
diff --git a/web/app/themes/haiku-atelier-2024/page-contact.php b/web/app/themes/haiku-atelier-2024/page-contact.php
index d9dae21c..c0d34ae4 100755
--- a/web/app/themes/haiku-atelier-2024/page-contact.php
+++ b/web/app/themes/haiku-atelier-2024/page-contact.php
@@ -1,4 +1,5 @@
ID);
+$url_accueil = get_page_link(get_page_by_path('home')->ID);
/** @var string $session_id L'ID de la Session Stripe liée à la Commande. */
-$session_id = $_GET["session_id"];
+$session_id = $_GET['session_id'];
// Redirige à l'Accueil si le paramètre d'ID de Session Stripe n'est pas présent avec un code HTTP 301
if (!$session_id) {
- header("Location: $url_accueil");
- return;
+ header("Location: {$url_accueil}");
+
+ return;
}
// Instancie un Client Stripe
-/** @var StripeClient $client_stripe Un Client Stripe pour récupérer les informations des Commande et Transaction .*/
-$client_stripe = new StripeClient(Config::get("STRIPE_API_SECRET"));
+/** @var StripeClient $client_stripe Un Client Stripe pour récupérer les informations des Commande et Transaction . */
+$client_stripe = new StripeClient(Config::get('STRIPE_API_SECRET'));
try {
- /** @var Session $session_stripe La Session Stripe pour la Commande. */
- $session_stripe = $client_stripe->checkout->sessions->retrieve($session_id);
- /** @var string $order_id L'ID de la Commande WooCommerce passée en métadonnée à la Session. */
- $order_id = $session_stripe->metadata["order_id"];
+ /** @var Session $session_stripe La Session Stripe pour la Commande. */
+ $session_stripe = $client_stripe->checkout->sessions->retrieve($session_id);
- /** @var WC_Order|WC_Order_Refund|bool $commande La Commande WooCommerce liée à la Session Stripe, `false` si inexistante. */
- $commande = wc_get_order("$order_id");
- /** @var WC_Cart $panier **/
- $panier = WC()->cart;
+ /** @var string $order_id L'ID de la Commande WooCommerce passée en métadonnée à la Session. */
+ $order_id = $session_stripe->metadata['order_id'];
- if ($commande == false) {
- throw new Error("La commande $order_id n'existe pas.");
- }
+ /** @var bool|WC_Order|WC_Order_Refund $commande La Commande WooCommerce liée à la Session Stripe, `false` si inexistante. */
+ $commande = wc_get_order("{$order_id}");
- // Passe la Commande en état "Payé" et réinitialise le Panier
- if ($commande->get_status() === "pending") {
- $commande->payment_complete($session_id);
- // $commande->set_payment_method_title("Stripe - Carte bancaire");
- $commande->set_transaction_id($session_id);
+ /** @var WC_Cart $panier */
+ $panier = WC()->cart;
- $panier->empty_cart();
- }
+ if (false === $commande) {
+ throw new Error("La commande {$order_id} n'existe pas.");
+ }
- // Contexte et modèles
- $contexte = Timber::context();
- $modeles = ["succes-commande.twig"];
+ // Passe la Commande en état "Payé" et réinitialise le Panier
+ if ('pending' === $commande->get_status()) {
+ $commande->payment_complete($session_id);
+ // $commande->set_payment_method_title("Stripe - Carte bancaire");
+ $commande->set_transaction_id($session_id);
- // Récupère les données des Produits
- /** @var mixed $produits Les Produits de la Commande sous forme de tableau contenant uniquement les données affichées nécessaires pour le Page. */
- $produits = collect($commande->get_items())->map(function (WC_Order_Item $produit_commande) use ($commande) {
- /** @var string $id_produit L'ID du Produit. */
- $id_produit = $produit_commande["product_id"];
- /** @var WC_Product|WC_Product_Variable|false $produit Les informations du Produit. */
- $produit = wc_get_product($produit_commande["product_id"]);
+ $panier->empty_cart();
+ }
- // Récupère le nom et la valeur de l'attribut du Produit
- $attribut = $produit->is_type("variable")
- ? collect($produit->get_attributes())
- ->mapWithKeys(function ($atr, $cle) use ($produit_commande) {
- $nom_attribut = wc_attribute_label($cle, $produit_commande->get_product());
- $valeur_attribut = $produit_commande->get_product()->get_attribute($cle);
- return [["nom" => $nom_attribut, "valeur" => $valeur_attribut]];
- })
- ->toArray()
- : [];
+ // Contexte et modèles
+ $contexte = Timber::context();
+ $modeles = ['succes-commande.twig'];
- return [
- "attribut" => $attribut,
- "id_produit" => $id_produit,
- "image" => pipe($produit->get_image_id(), fn($id) => genere_balise_img_multiformats(id: $id, lazy: true)),
- "permalien" => $produit->get_permalink(),
- "prix" => $produit_commande->get_data()["total"],
- "quantite" => $produit_commande->get_quantity(),
- "titre" => $produit->get_title(),
- ];
- });
+ // Récupère les données des Produits
+ /** @var mixed $produits Les Produits de la Commande sous forme de tableau contenant uniquement les données affichées nécessaires pour le Page. */
+ $produits = collect($commande->get_items())->map(function (WC_Order_Item $produit_commande) {
+ /** @var string $id_produit L'ID du Produit. */
+ $id_produit = $produit_commande['product_id'];
- $contexte["produits"] = $produits;
+ /** @var false|WC_Product|WC_Product_Variable $produit Les informations du Produit. */
+ $produit = wc_get_product($produit_commande['product_id']);
- // Charge les scripts et styles de la page
- function charge_scripts_styles_page_succes_commande(): void {
- wp_enqueue_style(
- handle: "haiku-atelier-2024-styles-page-succes-commande",
- src: get_template_directory_uri() . "/assets/css/pages/page-succes-commande.css",
- deps: [],
- ver: filemtime(get_template_directory() . "/assets/css/pages/page-succes-commande.css"),
- media: "all",
+ // Récupère le nom et la valeur de l'attribut du Produit
+ $attribut = $produit->is_type('variable')
+ ? collect($produit->get_attributes())->mapWithKeys(function ($atr, $cle) use ($produit_commande) {
+ $nom_attribut = wc_attribute_label($cle, $produit_commande->get_product());
+ $valeur_attribut = $produit_commande->get_product()->get_attribute($cle);
+
+ return [['nom' => $nom_attribut, 'valeur' => $valeur_attribut]];
+ })->toArray()
+ : [];
+
+ return [
+ 'attribut' => $attribut,
+ 'id_produit' => $id_produit,
+ 'image' => pipe($produit->get_image_id(), fn($id) => genere_balise_img_multiformats(
+ id: $id,
+ lazy: true,
+ )),
+ 'permalien' => $produit->get_permalink(),
+ 'prix' => $produit_commande->get_data()['total'],
+ 'quantite' => $produit_commande->get_quantity(),
+ 'titre' => $produit->get_title(),
+ ];
+ });
+
+ $contexte['produits'] = $produits;
+
+ // Charge les scripts et styles de la page
+ function charge_scripts_styles_page_succes_commande(): void {
+ wp_enqueue_style(
+ handle: 'haiku-atelier-2024-styles-page-succes-commande',
+ src: get_template_directory_uri() . '/assets/css/pages/page-succes-commande.css',
+ deps: [],
+ ver: filemtime(get_template_directory() . '/assets/css/pages/page-succes-commande.css'),
+ media: 'all',
+ );
+ }
+
+ add_action('wp_enqueue_scripts', 'charge_scripts_styles_page_succes_commande');
+
+ // Rendu
+ Timber::render(
+ filenames: $modeles,
+ data: $contexte,
);
- }
- add_action("wp_enqueue_scripts", "charge_scripts_styles_page_succes_commande");
-
- // Rendu
- Timber::render(filenames: $modeles, data: $contexte);
} catch (Error $e) {
- http_response_code(500);
- echo json_encode(["error" => $e->getMessage()]);
+ http_response_code(500);
+ echo json_encode(['error' => esc_html($e->getMessage())]);
}
diff --git a/web/app/themes/haiku-atelier-2024/page-terms-and-conditions.php b/web/app/themes/haiku-atelier-2024/page-terms-and-conditions.php
index 14d5e5c2..ef557e4a 100755
--- a/web/app/themes/haiku-atelier-2024/page-terms-and-conditions.php
+++ b/web/app/themes/haiku-atelier-2024/page-terms-and-conditions.php
@@ -1,4 +1,5 @@
get_type() == "variable";
+$est_produit_variable = 'variable' === $produit->get_type();
+
/** @var InformationsVariation[] $variations_produit Un tableau des informations d'affichage de chaque Variation du Produit */
$variations_produit = pipe(
- // Récupère les IDs des Enfants (Variations)
- wc_get_product()->get_children(),
- // Récupère les Variations
- fn($enfants) => array_map(callback: fn($id) => wc_get_product($id), array: $enfants),
- // Ne conserve que les Informations souhaitées
- fn($variations) => array_map(
- callback: function ($variation) {
- return [
- "id" => $variation->get_id(),
- // Ne récupère que le titre de l'Attribut unique de la Variation
- "titre" => match (true) {
- $variation->get_attribute("pa_side") !== "" => $variation->get_attribute("pa_side"),
- $variation->get_attribute("pa_stone") !== "" => $variation->get_attribute("pa_stone"),
- $variation->get_attribute("pa_size") !== "" => $variation->get_attribute("pa_size"),
- default => "",
- },
- "prix" => $variation->get_price(),
- ];
- },
- array: $variations,
- ),
+ // Récupère les IDs des Enfants (Variations)
+ wc_get_product()->get_children(),
+ // Récupère les Variations
+ fn($enfants) => array_map(
+ callback: wc_get_product(...),
+ array: $enfants,
+ ),
+ // Ne conserve que les Informations souhaitées
+ fn($variations) => array_map(
+ callback: fn($variation) => [
+ 'id' => $variation->get_id(),
+ // Ne récupère que le titre de l'Attribut unique de la Variation
+ 'titre' => match (true) {
+ '' !== $variation->get_attribute('pa_side') => $variation->get_attribute('pa_side'),
+ '' !== $variation->get_attribute('pa_stone') => $variation->get_attribute('pa_stone'),
+ '' !== $variation->get_attribute('pa_size') => $variation->get_attribute('pa_size'),
+ default => '',
+ },
+ 'prix' => $variation->get_price(),
+ ],
+ array: $variations,
+ ),
);
+
/** @var int $prix_maximal Le prix de la Variation la plus chère */
-$prix_maximal = collect($variations_produit)->max("prix");
+$prix_maximal = collect($variations_produit)->max('prix');
$produits_meme_collection = array_map(
- callback: "recupere_informations_produit_page_produit",
- array: recupere_produits_meme_collection($donnees_produit["collection"])($donnees_produit["id"]),
+ callback: 'recupere_informations_produit_page_produit',
+ array: recupere_produits_meme_collection($donnees_produit['collection'])($donnees_produit['id']),
);
// Déboguage en cas d'images fantômes
@@ -60,29 +67,33 @@ $produits_meme_collection = array_map(
// print_r($variations_produit);
// echo "";
-$contexte["produit"] = $donnees_produit;
-$contexte["prix_maximal"] = $prix_maximal;
-$contexte["variations_produit"] = $variations_produit;
-$contexte["produits_meme_collection"] = $produits_meme_collection;
+$contexte['produit'] = $donnees_produit;
+$contexte['prix_maximal'] = $prix_maximal;
+$contexte['variations_produit'] = $variations_produit;
+$contexte['produits_meme_collection'] = $produits_meme_collection;
/**
* Charge les Scripts nécessaires pour la page Produit.
*/
function charge_scripts_page_produit(): void {
- wp_enqueue_script_module(
- id: "haiku-atelier-2024-scripts-page-produit",
- src: get_template_directory_uri() . "/assets/js/scripts-page-produit.js",
- deps: [],
- version: filemtime(get_template_directory() . "/assets/js/scripts-page-produit.js"),
- );
- wp_enqueue_script_module(
- id: "haiku-atelier-2024-scripts-menu-categories",
- src: get_template_directory_uri() . "/assets/js/scripts-menu-categories.js",
- deps: [],
- version: filemtime(get_template_directory() . "/assets/js/scripts-menu-categories.js"),
- );
+ wp_enqueue_script_module(
+ id: 'haiku-atelier-2024-scripts-page-produit',
+ src: get_template_directory_uri() . '/assets/js/scripts-page-produit.js',
+ deps: [],
+ version: filemtime(get_template_directory() . '/assets/js/scripts-page-produit.js'),
+ );
+ wp_enqueue_script_module(
+ id: 'haiku-atelier-2024-scripts-menu-categories',
+ src: get_template_directory_uri() . '/assets/js/scripts-menu-categories.js',
+ deps: [],
+ version: filemtime(get_template_directory() . '/assets/js/scripts-menu-categories.js'),
+ );
}
-add_action("wp_enqueue_scripts", "charge_scripts_page_produit");
+
+add_action('wp_enqueue_scripts', 'charge_scripts_page_produit');
// Rendu
-Timber::render(filenames: $modeles, data: $contexte);
+Timber::render(
+ filenames: $modeles,
+ data: $contexte,
+);
diff --git a/web/app/themes/haiku-atelier-2024/src/StarterSite.php b/web/app/themes/haiku-atelier-2024/src/StarterSite.php
index ad40ebee..a8d528d0 100755
--- a/web/app/themes/haiku-atelier-2024/src/StarterSite.php
+++ b/web/app/themes/haiku-atelier-2024/src/StarterSite.php
@@ -7,170 +7,167 @@ namespace HaikuAtelier;
use Roots\WPConfig\Config;
use Timber\Site;
use Timber\URLHelper;
+
use function Crell\fp\pipe;
use function Env\env;
class StarterSite extends Site {
- public function __construct() {
- add_action("after_setup_theme", [$this, "defini_fonctionnalites_theme"]);
- add_action("after_setup_theme", [$this, "charge_traductions_theme"]);
+ public function __construct() {
+ add_action('after_setup_theme', [$this, 'defini_fonctionnalites_theme']);
+ add_action('after_setup_theme', [$this, 'charge_traductions_theme']);
- add_action("timber/context", [$this, "ajoute_au_contexte_twig"]);
- add_action("timber/twig/environment/options", [$this, "maj_environnement_twig"]);
+ add_action('timber/context', [$this, 'ajoute_au_contexte_twig']);
+ add_action('timber/twig/environment/options', [$this, 'maj_environnement_twig']);
- parent::__construct();
- }
+ parent::__construct();
+ }
- /**
- * @param array $context
- * @return array
- */
- public function ajoute_au_contexte_twig(array $context): array {
- $context["site"] = $this;
+ /**
+ * @param array $context
+ * @return array
+ */
+ public function ajoute_au_contexte_twig(array $context): array {
+ $context['site'] = $this;
- $context["environnement"] = env("WP_ENV");
+ $context['environnement'] = env('WP_ENV');
- // Récupère les liens des réseaux sociaux définis dans la personnalisation du thème
- $personnalisations_theme = get_theme_mods();
- $liens_reseaux_sociaux = [
- "facebook" => [
- "nom" => "Facebook",
- "url" => $personnalisations_theme["lien_facebook"] ?? "",
- ],
- "instagram" => [
- "nom" => "Instagram",
- "url" => $personnalisations_theme["lien_instagram"] ?? "",
- ],
- "pinterest" => [
- "nom" => "Pinterest",
- "url" => $personnalisations_theme["lien_pinterest"] ?? "",
- ],
- ];
- $context["liens_reseaux_sociaux"] = $liens_reseaux_sociaux;
+ // Récupère les liens des réseaux sociaux définis dans la personnalisation du thème
+ $personnalisations_theme = get_theme_mods();
+ $liens_reseaux_sociaux = [
+ 'facebook' => ['nom' => 'Facebook', 'url' => $personnalisations_theme['lien_facebook'] ?? ''],
+ 'instagram' => ['nom' => 'Instagram', 'url' => $personnalisations_theme['lien_instagram'] ?? ''],
+ 'pinterest' => ['nom' => 'Pinterest', 'url' => $personnalisations_theme['lien_pinterest'] ?? ''],
+ ];
+ $context['liens_reseaux_sociaux'] = $liens_reseaux_sociaux;
- // Récupère les textes apparaissant sur les pages Produits
- $descriptions_produits = [
- "texte_conditions_livraison" => wpautop($personnalisations_theme["texte_conditions_livraison"]) ?? "",
- "texte_entretien_produit" => wpautop($personnalisations_theme["texte_entretien_produit"]) ?? "",
- ];
- $context["descriptions_produits"] = $descriptions_produits;
+ // Récupère les textes apparaissant sur les pages Produits
+ $descriptions_produits = [
+ 'texte_conditions_livraison' => wpautop($personnalisations_theme['texte_conditions_livraison']) ?? '',
+ 'texte_entretien_produit' => wpautop($personnalisations_theme['texte_entretien_produit']) ?? '',
+ ];
+ $context['descriptions_produits'] = $descriptions_produits;
- // Logo personnalisée
- $context["logo"] = pipe(
- get_theme_mod("custom_logo"),
- fn($id) => wp_get_attachment_image_src(attachment_id: $id, size: "full"),
- );
+ // Logo personnalisée
+ $context['logo'] = pipe(get_theme_mod('custom_logo'), fn($id) => wp_get_attachment_image_src(
+ attachment_id: $id,
+ size: 'full',
+ ));
- // Informations des Pages
- $recupere_informations_page = function ($slug) {
- $page = get_page_by_path($slug);
+ // Informations des Pages
+ $recupere_informations_page = function ($slug) {
+ $page = get_page_by_path($slug);
- return (object) [
- "nom" => $page->post_title ?? "",
- "lien" => get_page_link($page?->ID),
- ];
- };
+ return (object) ['nom' => $page->post_title ?? '', 'lien' => get_page_link($page?->ID)];
+ };
- // Pages spécifiques
- $context["pages"] = (object) [
- "about" => $recupere_informations_page("about"),
- "account" => $recupere_informations_page("account"),
- "cart" => $recupere_informations_page("cart"),
- "checkout" => $recupere_informations_page("checkout"),
- "contact" => $recupere_informations_page("contact"),
- "failed_order" => $recupere_informations_page("failed_order"),
- "home" => $recupere_informations_page("home"),
- "shop" => $recupere_informations_page("shop"),
- "successful_order" => $recupere_informations_page("successful_order"),
- ];
+ // Pages spécifiques
+ $context['pages'] = (object) [
+ 'about' => $recupere_informations_page('about'),
+ 'account' => $recupere_informations_page('account'),
+ 'cart' => $recupere_informations_page('cart'),
+ 'checkout' => $recupere_informations_page('checkout'),
+ 'contact' => $recupere_informations_page('contact'),
+ 'failed_order' => $recupere_informations_page('failed_order'),
+ 'home' => $recupere_informations_page('home'),
+ 'shop' => $recupere_informations_page('shop'),
+ 'successful_order' => $recupere_informations_page('successful_order'),
+ ];
- // Récupère la Page courante
- $url_courante = URLHelper::get_current_url();
- $context["page_courante"] = $url_courante;
- $context["est_page_tous_produits"] = preg_match(pattern: "/(\bshop\b)/", subject: $url_courante);
- $context["est_page_boutique"] =
- preg_match(pattern: "/(\bshop\b)/", subject: $url_courante) ||
- preg_match(pattern: "/(\bproduct\b)/", subject: $url_courante) ||
- preg_match(pattern: "/(\bproduct-category\b)/", subject: $url_courante);
+ // Récupère la Page courante
+ $url_courante = URLHelper::get_current_url();
+ $context['page_courante'] = $url_courante;
+ $context['est_page_tous_produits'] = preg_match(
+ pattern: '/(\bshop\b)/',
+ subject: $url_courante,
+ );
+ $context['est_page_boutique'] = preg_match(
+ pattern: '/(\bshop\b)/',
+ subject: $url_courante,
+ )
+ || preg_match(
+ pattern: '/(\bproduct\b)/',
+ subject: $url_courante,
+ )
+ || preg_match(
+ pattern: '/(\bproduct-category\b)/',
+ subject: $url_courante,
+ );
- // Politique de confidentialité
- $politique_confidentialite_lien = pipe(get_privacy_policy_url(), fn($url) => esc_url($url));
- $context["lien_politique_confidentialite"] = $politique_confidentialite_lien;
+ // Politique de confidentialité
+ $politique_confidentialite_lien = pipe(get_privacy_policy_url(), esc_url(...));
+ $context['lien_politique_confidentialite'] = $politique_confidentialite_lien;
- // Chemin de base pour une Catégorie de Produit (p. ex. /product-category/)
- $context["base_categorie_produit"] = get_option("woocommerce_permalinks")["category_base"] ?? "";
+ // Chemin de base pour une Catégorie de Produit (p. ex. /product-category/)
+ $context['base_categorie_produit'] = get_option('woocommerce_permalinks')['category_base'] ?? '';
- /* Récupère les Catégories de Produits */
- $cree_entree_menu = fn($categorie) => [
- "nom" => $categorie->name,
- "slug" => $categorie->slug,
- // Détermine si l'URL courante est celle de la Page d'Archive d'une Catégorie de Produits
- "courante" => preg_match(
- pattern: "/(\b$categorie->slug\b)/",
- subject: pipe(URLHelper::get_current_url(), fn($url) => URLHelper::get_rel_url($url)),
- ),
- ];
- $entrees_menu_categories = pipe(
- get_categories([
- "hide_empty" => false,
- "orderby" => "menu_order",
- "taxonomy" => "product_cat",
- ]),
- fn($categories) => array_map(callback: $cree_entree_menu, array: $categories),
- );
+ // Récupère les Catégories de Produits
+ $cree_entree_menu = fn($categorie) => [
+ 'nom' => $categorie->name,
+ 'slug' => $categorie->slug,
+ // Détermine si l'URL courante est celle de la Page d'Archive d'une Catégorie de Produits
+ 'courante' => preg_match(
+ pattern: "/(\\b{$categorie->slug}\\b)/",
+ subject: pipe(URLHelper::get_current_url(), URLHelper::get_rel_url(...)),
+ ),
+ ];
+ $entrees_menu_categories = pipe(
+ get_categories(['hide_empty' => false, 'orderby' => 'menu_order', 'taxonomy' => 'product_cat']),
+ fn($categories) => array_map(
+ callback: $cree_entree_menu,
+ array: $categories,
+ ),
+ );
- $context["categories_produits"] = $entrees_menu_categories;
+ $context['categories_produits'] = $entrees_menu_categories;
- // Récupère le Panier de l'Utilisateur
- $panier = WC()?->cart?->get_cart();
- $quantite_articles = WC()?->cart?->get_cart_contents_count();
- $articles_presents = $quantite_articles > 0 ? "true" : "false";
+ // Récupère le Panier de l'Utilisateur
+ $panier = WC()?->cart?->get_cart();
+ $quantite_articles = WC()?->cart?->get_cart_contents_count();
+ $articles_presents = $quantite_articles > 0 ? 'true' : 'false';
- $context["panier"] = $panier;
- $context["quantite_articles"] = $quantite_articles;
- $context["articles_presents"] = $articles_presents;
+ $context['panier'] = $panier;
+ $context['quantite_articles'] = $quantite_articles;
+ $context['articles_presents'] = $articles_presents;
- // Nonce WooCommerce pour l'API Rest
- $nonce_wc = wp_create_nonce("wc_store_api");
- $context["nonce_wc"] = $nonce_wc;
- // TODO: Utiliser des variables d'environnement
- $auth_string = base64_encode(
- Config::get("WOOCOMMERCE_API_CONSUMER_KEY") . ":" . Config::get("WOOCOMMERCE_API_CONSUMER_SECRET"),
- );
- $context["auth_string"] = $auth_string;
+ // Nonce WooCommerce pour l'API Rest
+ $nonce_wc = wp_create_nonce('wc_store_api');
+ $context['nonce_wc'] = $nonce_wc;
+ // TODO: Utiliser des variables d'environnement
+ $auth_string = base64_encode(
+ Config::get('WOOCOMMERCE_API_CONSUMER_KEY') . ':' . Config::get('WOOCOMMERCE_API_CONSUMER_SECRET'),
+ );
+ $context['auth_string'] = $auth_string;
- return $context;
- }
+ return $context;
+ }
- public function defini_fonctionnalites_theme(): void {
- // Laisse WordPress gérer le titre de la page
- add_theme_support("title-tag");
+ public function defini_fonctionnalites_theme(): void {
+ // Laisse WordPress gérer le titre de la page
+ add_theme_support('title-tag');
- // Ajoute les Miniatures aux Posts et Pages
- add_theme_support("post-thumbnails");
+ // Ajoute les Miniatures aux Posts et Pages
+ add_theme_support('post-thumbnails');
- // Utilise des éléments sémantiques HTML5 pour ces éléments générés par WordPress
- add_theme_support("html5", ["comment-list", "comment-form", "search-form", "gallery", "caption"]);
+ // Utilise des éléments sémantiques HTML5 pour ces éléments générés par WordPress
+ add_theme_support('html5', ['comment-list', 'comment-form', 'search-form', 'gallery', 'caption']);
- // Ajoute la possibilité d'un Logo personnalisé
- add_theme_support("custom-logo");
+ // Ajoute la possibilité d'un Logo personnalisé
+ add_theme_support('custom-logo');
- // Ajoute la prise en charge de WooCommerce
- add_theme_support("woocommerce");
- }
+ // Ajoute la prise en charge de WooCommerce
+ add_theme_support('woocommerce');
+ }
- /**
- * Met à jour l'environnement de Twig.
- *
- * @param array $options Un tableau avec les options d'environnement.
- *
- * @return array
- */
- public function maj_environnement_twig(array $options): array {
- return $options;
- }
+ /**
+ * Met à jour l'environnement de Twig.
+ *
+ * @param array $options un tableau avec les options d'environnement
+ */
+ public function maj_environnement_twig(array $options): array {
+ return $options;
+ }
- // public function charge_traductions_theme(): void {
- // load_theme_textdomain("haiku-atelier-2024", get_template_directory() . "/languages");
- // }
+ // public function charge_traductions_theme(): void {
+ // load_theme_textdomain("haiku-atelier-2024", get_template_directory() . "/languages");
+ // }
}
diff --git a/web/app/themes/haiku-atelier-2024/src/gleam/README.md b/web/app/themes/haiku-atelier-2024/src/gleam/README.md
deleted file mode 100644
index 48c4c260..00000000
--- a/web/app/themes/haiku-atelier-2024/src/gleam/README.md
+++ /dev/null
@@ -1,25 +0,0 @@
-# haiku_gleam
-
-[](https://hex.pm/packages/haiku_gleam)
-[](https://hexdocs.pm/haiku_gleam/)
-
-```sh
-gleam add haiku_gleam@1
-```
-
-```gleam
-import haiku_gleam
-
-pub fn main() -> Nil {
- // TODO: An example of the project in use
-}
-```
-
-Further documentation can be found at .
-
-## Development
-
-```sh
-gleam run # Run the project
-gleam test # Run the tests
-```
diff --git a/web/app/themes/haiku-atelier-2024/src/gleam/gleam.toml b/web/app/themes/haiku-atelier-2024/src/gleam/gleam.toml
deleted file mode 100644
index efd5f7ef..00000000
--- a/web/app/themes/haiku-atelier-2024/src/gleam/gleam.toml
+++ /dev/null
@@ -1,11 +0,0 @@
-name = "haiku_gleam"
-target = "javascript"
-version = "0.0.1"
-
-[dependencies]
-gleam_javascript = ">= 1.0.0 and < 2.0.0"
-gleam_stdlib = ">= 0.44.0 and < 2.0.0"
-plinth = ">= 0.6.1 and < 1.0.0"
-
-[dev-dependencies]
-gleeunit = ">= 1.0.0 and < 2.0.0"
diff --git a/web/app/themes/haiku-atelier-2024/src/gleam/manifest.toml b/web/app/themes/haiku-atelier-2024/src/gleam/manifest.toml
deleted file mode 100644
index 0462f043..00000000
--- a/web/app/themes/haiku-atelier-2024/src/gleam/manifest.toml
+++ /dev/null
@@ -1,16 +0,0 @@
-# This file was generated by Gleam
-# You typically do not need to edit this file
-
-packages = [
- { name = "gleam_javascript", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_javascript", source = "hex", outer_checksum = "EF6C77A506F026C6FB37941889477CD5E4234FCD4337FF0E9384E297CB8F97EB" },
- { name = "gleam_json", version = "3.0.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "5BA154440B22D9800955B1AB854282FA37B97F30F409D76B0824D0A60C934188" },
- { name = "gleam_stdlib", version = "0.60.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "621D600BB134BC239CB2537630899817B1A42E60A1D46C5E9F3FAE39F88C800B" },
- { name = "gleeunit", version = "1.5.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "D33B7736CF0766ED3065F64A1EBB351E72B2E8DE39BAFC8ADA0E35E92A6A934F" },
- { name = "plinth", version = "0.6.1", build_tools = ["gleam"], requirements = ["gleam_javascript", "gleam_json", "gleam_stdlib"], otp_app = "plinth", source = "hex", outer_checksum = "02D6421A27795CDC5C3A452240E21D5D3CB8217219020BB247917132E36CC8F1" },
-]
-
-[requirements]
-gleam_javascript = { version = ">= 1.0.0 and < 2.0.0" }
-gleam_stdlib = { version = ">= 0.44.0 and < 2.0.0" }
-gleeunit = { version = ">= 1.0.0 and < 2.0.0" }
-plinth = { version = ">= 0.6.1 and < 1.0.0" }
diff --git a/web/app/themes/haiku-atelier-2024/src/gleam/src/haiku_gleam.gleam b/web/app/themes/haiku-atelier-2024/src/gleam/src/haiku_gleam.gleam
deleted file mode 100644
index 5e1d9fb3..00000000
--- a/web/app/themes/haiku-atelier-2024/src/gleam/src/haiku_gleam.gleam
+++ /dev/null
@@ -1,5 +0,0 @@
-import gleam/io
-
-pub fn main() -> Nil {
- io.println("Hello from haiku_gleam!")
-}
diff --git a/web/app/themes/haiku-atelier-2024/src/gleam/src/intersection_observer.ffi.mjs b/web/app/themes/haiku-atelier-2024/src/gleam/src/intersection_observer.ffi.mjs
deleted file mode 100644
index 3cbf44bf..00000000
--- a/web/app/themes/haiku-atelier-2024/src/gleam/src/intersection_observer.ffi.mjs
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * @param {IntersectionObserverInit} options
- * @param {IntersectionObserverCallback} callback
- * @returns {IntersectionObserver}
- */
-export const new_intersection_observer = (options, callback) => {
- return new IntersectionObserver(callback, options);
-};
-
-/**
- * @param {IntersectionObserver} observer
- * @param {Element} element
- */
-export const observe_element = (observer, element) => {
- observer.observe(element);
-};
diff --git a/web/app/themes/haiku-atelier-2024/src/gleam/src/intersection_observer.gleam b/web/app/themes/haiku-atelier-2024/src/gleam/src/intersection_observer.gleam
deleted file mode 100644
index 7b3a275e..00000000
--- a/web/app/themes/haiku-atelier-2024/src/gleam/src/intersection_observer.gleam
+++ /dev/null
@@ -1,22 +0,0 @@
-import gleam/option.{type Option}
-import plinth/browser/document
-import plinth/browser/element
-
-pub type IntersectionObserver
-
-pub type ObservableElement {
- Element(element.Element)
- Document(document.Document)
-}
-
-pub type Threshold {
- Threshold(values: List(Int))
-}
-
-pub type IntersectionObserverOptions {
- IntersectionObserverOptions(
- root: ObservableElement,
- root_margin: Option(String),
- threshold: Threshold,
- )
-}
diff --git a/web/app/themes/haiku-atelier-2024/src/gleam/test/haiku_gleam_test.gleam b/web/app/themes/haiku-atelier-2024/src/gleam/test/haiku_gleam_test.gleam
deleted file mode 100644
index fba3c887..00000000
--- a/web/app/themes/haiku-atelier-2024/src/gleam/test/haiku_gleam_test.gleam
+++ /dev/null
@@ -1,13 +0,0 @@
-import gleeunit
-
-pub fn main() -> Nil {
- gleeunit.main()
-}
-
-// gleeunit test functions end in `_test`
-pub fn hello_world_test() {
- let name = "Joe"
- let greeting = "Hello, " <> name <> "!"
-
- assert greeting == "Hello, Joe!"
-}
diff --git a/web/app/themes/haiku-atelier-2024/src/inc/APIRest.php b/web/app/themes/haiku-atelier-2024/src/inc/APIRest.php
index 7987df67..8b137891 100755
--- a/web/app/themes/haiku-atelier-2024/src/inc/APIRest.php
+++ b/web/app/themes/haiku-atelier-2024/src/inc/APIRest.php
@@ -1,4 +1 @@
-where("post_type", "=", "product")
- ->add_fields([
- /* Galerie des photos Produit */
- Field::make("media_gallery", "photos_colonne_gauche", __("Left Column Photos"))
- ->set_type(["image"])
- ->set_duplicates_allowed(false),
- /* Galerie des photos portées */
- Field::make("media_gallery", "photos_colonne_droite", __("Right Column Photos"))
- ->set_type(["image"])
- ->set_duplicates_allowed(false),
- /* Texte des détails du Produit */
- Field::make("rich_text", "haiku_details_produit", __("Product's Details")),
- ]);
+ Container::make('post_meta', "Product's Details")
+ ->where('post_type', '=', 'product')
+ ->add_fields([
+ // Galerie des photos Produit
+ Field::make('media_gallery', 'photos_colonne_gauche', __('Left Column Photos'))
+ ->set_type(['image'])
+ ->set_duplicates_allowed(false),
+ // Galerie des photos portées
+ Field::make('media_gallery', 'photos_colonne_droite', __('Right Column Photos'))
+ ->set_type(['image'])
+ ->set_duplicates_allowed(false),
+ // Texte des détails du Produit
+ Field::make('rich_text', 'haiku_details_produit', __("Product's Details")),
+ ]);
}
function cree_champ_personnalise_commande($order): void {
- woocommerce_wp_text_input([
- "id" => "tracking_number",
- "label" => "Tracking Number:",
- "value" => $order->get_meta("tracking_number"),
- "wrapper_class" => "form-field-wide",
- ]);
+ woocommerce_wp_text_input([
+ 'id' => 'tracking_number',
+ 'label' => 'Tracking Number:',
+ 'value' => $order->get_meta('tracking_number'),
+ 'wrapper_class' => 'form-field-wide',
+ ]);
}
function maj_champ_personnalise_commande($order_id): void {
- $order = wc_get_order($order_id);
- $order->update_meta_data("tracking_number", wc_clean($_POST["tracking_number"]));
- $order->save();
+ $order = wc_get_order($order_id);
+ $order->update_meta_data('tracking_number', wc_clean($_POST['tracking_number']));
+ $order->save();
}
-add_action("carbon_fields_register_fields", "cree_champs_personnalises_produit");
-add_action("woocommerce_admin_order_data_after_shipping_address", "cree_champ_personnalise_commande");
-add_action("woocommerce_process_shop_order_meta", "maj_champ_personnalise_commande");
+add_action('carbon_fields_register_fields', 'cree_champs_personnalises_produit');
+add_action('woocommerce_admin_order_data_after_shipping_address', 'cree_champ_personnalise_commande');
+add_action('woocommerce_process_shop_order_meta', 'maj_champ_personnalise_commande');
diff --git a/web/app/themes/haiku-atelier-2024/src/inc/ControlesPersonnalises.php b/web/app/themes/haiku-atelier-2024/src/inc/ControlesPersonnalises.php
index 7e06c0cf..6d9dadbd 100755
--- a/web/app/themes/haiku-atelier-2024/src/inc/ControlesPersonnalises.php
+++ b/web/app/themes/haiku-atelier-2024/src/inc/ControlesPersonnalises.php
@@ -8,68 +8,68 @@
declare(strict_types=1);
function enregistre_controle_personnalise_tinymce(): void {
- /**
- * TinyMCE Custom Control
- *
- * @author Anthony Hortin
- * @license http://www.gnu.org/licenses/gpl-2.0.html
- * @link https://github.com/maddisondesigns
- */
- class Controle_Personnalise_TinyMCE extends WP_Customize_Control {
/**
- * The type of control being rendered
+ * TinyMCE Custom Control.
+ *
+ * @author Anthony Hortin
+ * @license http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * @see https://github.com/maddisondesigns
*/
- public $type = "editeur_tinymce";
+ class Controle_Personnalise_TinyMCE extends WP_Customize_Control {
+ /**
+ * The type of control being rendered.
+ */
+ public $type = 'editeur_tinymce';
- /**
- * Enqueue our scripts and styles
- */
- public function enqueue(): void {
- wp_enqueue_script(
- handle: "controle-personnalise-tinymce",
- src: get_template_directory_uri() . "/assets/vendor/controle-personnalise-tinymce.js",
- deps: ["jquery"],
- ver: "1.3",
- args: true,
- );
- wp_enqueue_editor();
- }
+ /**
+ * Enqueue our scripts and styles.
+ */
+ public function enqueue(): void {
+ wp_enqueue_script(
+ handle: 'controle-personnalise-tinymce',
+ src: get_template_directory_uri() . '/assets/vendor/controle-personnalise-tinymce.js',
+ deps: ['jquery'],
+ ver: '1.3',
+ args: true,
+ );
+ wp_enqueue_editor();
+ }
- /**
- * Pass our TinyMCE toolbar string to JavaScript
- */
- public function to_json(): void {
- parent::to_json();
+ /**
+ * Pass our TinyMCE toolbar string to JavaScript.
+ */
+ public function to_json(): void {
+ parent::to_json();
- $this->json["skyrockettinymcetoolbar1"] = isset($this->input_attrs["toolbar1"])
- ? esc_attr($this->input_attrs["toolbar1"])
- : "bold italic bullist numlist alignleft aligncenter alignright link";
+ $this->json['skyrockettinymcetoolbar1'] = isset($this->input_attrs['toolbar1'])
+ ? esc_attr($this->input_attrs['toolbar1'])
+ : 'bold italic bullist numlist alignleft aligncenter alignright link';
- $this->json["skyrockettinymcetoolbar2"] = isset($this->input_attrs["toolbar2"])
- ? esc_attr($this->input_attrs["toolbar2"])
- : "";
- $this->json["skyrocketmediabuttons"] =
- isset($this->input_attrs["mediaButtons"]) && $this->input_attrs["mediaButtons"] === true ? true : false;
- }
+ $this->json['skyrockettinymcetoolbar2'] = isset($this->input_attrs['toolbar2'])
+ ? esc_attr($this->input_attrs['toolbar2'])
+ : '';
+ $this->json['skyrocketmediabuttons'] = isset($this->input_attrs['mediaButtons'])
+ && $this->input_attrs['mediaButtons'] === true
+ ? true
+ : false;
+ }
- /**
- * Render the control in the customizer
- */
- public function render_content() {
- ?>
+ /**
+ * Render the control in the customizer.
+ */
+ public function render_content() { ?>
label); ?>
description)) { ?>
description); ?>
-
+
- $configuration Un tableau associatif de la configuration TinyMCE.
- * @return array Le même tableau avec des configurations en plus.
+ * @param array $configuration un tableau associatif de la configuration TinyMCE
+ * @return array le même tableau avec des configurations en plus
*/
function desactive_transformation_contenu_tinymce(array $configuration): array {
- // Ne supprime pas les retours à la ligne
- $configuration["remove_linebreaks"] = false;
- // Convertis les caractères de retours à la ligne en
- $configuration["convert_newlines_to_brs"] = true;
- // Supprime les
redondants
- $configuration["remove_redundant_brs"] = false;
+ // Ne supprime pas les retours à la ligne
+ $configuration['remove_linebreaks'] = false;
+ // Convertis les caractères de retours à la ligne en
+ $configuration['convert_newlines_to_brs'] = true;
+ // Supprime les
redondants
+ $configuration['remove_redundant_brs'] = false;
- // Retourne $configuration à WordPress
- return $configuration;
+ // Retourne $configuration à WordPress
+ return $configuration;
}
/**
* Autorise les imports en SVG dans la médiathèque.
*
- * @param array $file_types Un tableau des types de fichiers autorisés dans la médiathèque.
- * @return array Le même tableau avec SVG en plus.
+ * @param array $file_types un tableau des types de fichiers autorisés dans la médiathèque
+ * @return array le même tableau avec SVG en plus
*/
function autorise_import_svg_mediatheque(array $file_types): array {
- $new_filetypes = [];
- $new_filetypes["svg"] = "image/svg+xml";
- $file_types = array_merge($file_types, $new_filetypes);
+ $new_filetypes = [];
+ $new_filetypes['svg'] = 'image/svg+xml';
- return $file_types;
+ return array_merge($file_types, $new_filetypes);
}
function retire_motifs_blocs_gutenberg(): void {
- remove_theme_support("core-block-patterns");
+ remove_theme_support('core-block-patterns');
}
function retire_styles_core_block(): void {
- wp_dequeue_style("core-block-supports");
+ wp_dequeue_style('core-block-supports');
}
// Désactive les appels à l'API de la mise à jour des traductions
-add_filter("async_update_translation", "__return_false");
-add_filter("auto_update_translation", "__return_false");
+add_filter('async_update_translation', '__return_false');
+add_filter('auto_update_translation', '__return_false');
-add_action("init", "desactive_wpautop");
-add_filter("tiny_mce_before_init", "desactive_transformation_contenu_tinymce");
-add_filter("upload_mimes", "autorise_import_svg_mediatheque");
-add_action("after_setup_theme", "retire_motifs_blocs_gutenberg");
-add_action("wp_footer", "retire_styles_core_block", 5);
+add_action('init', 'desactive_wpautop');
+add_filter('tiny_mce_before_init', 'desactive_transformation_contenu_tinymce');
+add_filter('upload_mimes', 'autorise_import_svg_mediatheque');
+add_action('after_setup_theme', 'retire_motifs_blocs_gutenberg');
+add_action('wp_footer', 'retire_styles_core_block', 5);
diff --git a/web/app/themes/haiku-atelier-2024/src/inc/FonctionnalitesWooCommerce.php b/web/app/themes/haiku-atelier-2024/src/inc/FonctionnalitesWooCommerce.php
index 7fa97b55..0c8a35ea 100755
--- a/web/app/themes/haiku-atelier-2024/src/inc/FonctionnalitesWooCommerce.php
+++ b/web/app/themes/haiku-atelier-2024/src/inc/FonctionnalitesWooCommerce.php
@@ -1,4 +1,5 @@
pour chaque image d'intérêt.
*
- * @param WP_REST_Response $response The response object.
- * @param WC_Data $product Object data.
+ * @param WP_REST_Response $response the response object
+ * @param WC_Data $product object data
+ *
* @return WP_REST_Response
*/
function genere_balises_img_dans_produit_dans_reponse_rest($response, $product) {
- // Vérifie que la Réponse a des données
- if (empty($response->data)) {
+ // Vérifie que la Réponse a des données
+ if (empty($response->data)) {
+ return $response;
+ }
+
+ // Génère la balise
pour l'image au repos
+ $response->data['image_repos'] = pipe(
+ $response->data['meta_data'],
+ fn($metadata) => array_filter(
+ array: $metadata,
+ callback: fn($entree) => '_photos_colonne_gauche|||0|value' === $entree->key,
+ ),
+ fn($metadata) => array_map(
+ array: $metadata,
+ callback: fn($entree) => genere_balise_img_multiformats(
+ id: $entree?->value,
+ lazy: true,
+ ),
+ ),
+ fn($image) => array_values(array: $image)[0],
+ );
+
+ // Génère la balise
pour l'image au survol
+ $response->data['image_survol'] = pipe(
+ $response->data['meta_data'],
+ fn($metadata) => array_filter(
+ array: $metadata,
+ callback: fn($entree) => '_photos_colonne_droite|||0|value' === $entree->key,
+ ),
+ fn($metadata) => array_map(
+ array: $metadata,
+ callback: fn($entree) => genere_balise_img_multiformats(
+ id: $entree?->value,
+ lazy: true,
+ ),
+ ),
+ fn($image) => array_values(array: $image)[0],
+ );
+
return $response;
- }
-
- // Génère la balise
pour l'image au repos
- $response->data["image_repos"] = pipe(
- $response->data["meta_data"],
- fn($metadata) => array_filter(
- array: $metadata,
- callback: fn($entree) => $entree->key == "_photos_colonne_gauche|||0|value",
- ),
- fn($metadata) => array_map(
- array: $metadata,
- callback: fn($entree) => genere_balise_img_multiformats(id: $entree?->value, lazy: true),
- ),
- fn($image) => array_values(array: $image)[0],
- );
-
- // Génère la balise
pour l'image au survol
- $response->data["image_survol"] = pipe(
- $response->data["meta_data"],
- fn($metadata) => array_filter(
- array: $metadata,
- callback: fn($entree) => $entree->key == "_photos_colonne_droite|||0|value",
- ),
- fn($metadata) => array_map(
- array: $metadata,
- callback: fn($entree) => genere_balise_img_multiformats(id: $entree?->value, lazy: true),
- ),
- fn($image) => array_values(array: $image)[0],
- );
-
- return $response;
}
-add_filter("woocommerce_rest_prepare_product_object", "genere_balises_img_dans_produit_dans_reponse_rest", 10, 2);
+
+add_filter('woocommerce_rest_prepare_product_object', 'genere_balises_img_dans_produit_dans_reponse_rest', 10, 2);
/**
- * TODO
+ * TODO.
*
* @param WP_REST_Respone $$reponse
- * @param WC_Data $produit
+ * @param WC_Data $produit
+ * @param mixed $reponse
+ *
* @return WP_REST_Response
*/
function genere_prix_maximal_produit_variable_dans_reponse_rest($reponse, $produit) {
- // Vérifie que la Réponse a des données
- if (empty($reponse->data)) {
+ // Vérifie que la Réponse a des données
+ if (empty($reponse->data)) {
+ return $reponse;
+ }
+
+ // Si le Produit n'est pas Variable, assigner le prix du Produit comme prix maximal
+ if ('variable' != $reponse->data['type']) {
+ $reponse->data['prix_maximal'] = $reponse->data['regular_price'];
+
+ return $reponse;
+ }
+
+ // Assigne le prix de la Variation la plus chère dans la Réponse
+ $reponse->data['prix_maximal'] = collect($reponse->data['variations'])->map(wc_get_product(...))->map(
+ fn($p) => $p->get_price(),
+ )->max();
+
return $reponse;
- }
-
- // Si le Produit n'est pas Variable, assigner le prix du Produit comme prix maximal
- if ($reponse->data["type"] != "variable") {
- $reponse->data["prix_maximal"] = $reponse->data["regular_price"];
- return $reponse;
- }
-
- // Assigne le prix de la Variation la plus chère dans la Réponse
- $reponse->data["prix_maximal"] = collect($reponse->data["variations"])
- ->map(fn($id) => wc_get_product($id))
- ->map(fn($p) => $p->get_price())
- ->max();
-
- return $reponse;
}
-add_filter("woocommerce_rest_prepare_product_object", "genere_prix_maximal_produit_variable_dans_reponse_rest", 10, 2);
+
+add_filter('woocommerce_rest_prepare_product_object', 'genere_prix_maximal_produit_variable_dans_reponse_rest', 10, 2);
/**
* Retire la propagande commerciale de WooCommerce du menu.
*/
function remove_payments_ad_tab(): void {
- remove_menu_page("admin.php?page=wc-settings&tab=checkout");
+ remove_menu_page('admin.php?page=wc-settings&tab=checkout');
}
-add_action("add_meta_boxes", "desactive_champs_admin_images_produit_woocommerce", 40);
-add_action("admin_menu", "remove_payments_ad_tab", 999);
-add_action("after_setup_theme", "desactive_images_produit_woocommerce");
-add_action("enqueue_block_assets", "desactive_blocs_gutenberg_woocommerce");
-add_action("init", "desactive_attribution_commande_woocommerce");
-add_action("init", "retire_script_galerie");
-add_action("template_redirect", "retire_merdes_wc");
-add_action("wp_enqueue_scripts", "dequeue_woocommerce_styles_scripts");
-add_filter("woocommerce_enqueue_styles", "__return_empty_array");
+add_action('add_meta_boxes', 'desactive_champs_admin_images_produit_woocommerce', 40);
+add_action('admin_menu', 'remove_payments_ad_tab', 999);
+add_action('after_setup_theme', 'desactive_images_produit_woocommerce');
+add_action('enqueue_block_assets', 'desactive_blocs_gutenberg_woocommerce');
+add_action('init', 'desactive_attribution_commande_woocommerce');
+add_action('init', 'retire_script_galerie');
+add_action('template_redirect', 'retire_merdes_wc');
+add_action('wp_enqueue_scripts', 'dequeue_woocommerce_styles_scripts');
+add_filter('woocommerce_enqueue_styles', '__return_empty_array');
diff --git a/web/app/themes/haiku-atelier-2024/src/inc/HTML.php b/web/app/themes/haiku-atelier-2024/src/inc/HTML.php
index 29ddf714..236161d0 100755
--- a/web/app/themes/haiku-atelier-2024/src/inc/HTML.php
+++ b/web/app/themes/haiku-atelier-2024/src/inc/HTML.php
@@ -1,4 +1,5 @@
` d'un Média attaché à un Produit selon son ID.
*
- * @param int $id_image
+ * @param int $id_image
* @return string
*/
function genere_balise_img($id_image) {
- return wp_get_attachment_image(attachment_id: $id_image, size: "full");
+ return wp_get_attachment_image(
+ attachment_id: $id_image,
+ size: 'full',
+ );
}
diff --git a/web/app/themes/haiku-atelier-2024/src/inc/Taxonomies.php b/web/app/themes/haiku-atelier-2024/src/inc/Taxonomies.php
index 083d2ba3..62132c6c 100755
--- a/web/app/themes/haiku-atelier-2024/src/inc/Taxonomies.php
+++ b/web/app/themes/haiku-atelier-2024/src/inc/Taxonomies.php
@@ -1,4 +1,5 @@
__("Add New Collection"),
- "all_items" => __("All Collections"),
- "edit_item" => __("Edit Collection"),
- "menu_name" => __("Collections"),
- "name" => __("Collections"),
- "new_item_name" => __("New Collection Name"),
- "search_items" => __("Search Collections"),
- "singular_name" => __("Collection"),
- "update_item" => __("Update Collection"),
- ];
- $args = [
- "description" => __("An ensemble of pieces thematically or chronologically grouped together."),
- "hierarchical" => false,
- "labels" => $labels,
- "publicly_queryable" => false,
- "query_var" => true,
- "rewrite" => ["slug" => "collection"],
- "show_admin_column" => true,
- "show_in_menu" => true,
- "show_in_quick_edit" => true,
- "show_ui" => true,
- ];
+ $labels = [
+ 'add_new_item' => __('Add New Collection'),
+ 'all_items' => __('All Collections'),
+ 'edit_item' => __('Edit Collection'),
+ 'menu_name' => __('Collections'),
+ 'name' => __('Collections'),
+ 'new_item_name' => __('New Collection Name'),
+ 'search_items' => __('Search Collections'),
+ 'singular_name' => __('Collection'),
+ 'update_item' => __('Update Collection'),
+ ];
+ $args = [
+ 'description' => __('An ensemble of pieces thematically or chronologically grouped together.'),
+ 'hierarchical' => false,
+ 'labels' => $labels,
+ 'publicly_queryable' => false,
+ 'query_var' => true,
+ 'rewrite' => ['slug' => 'collection'],
+ 'show_admin_column' => true,
+ 'show_in_menu' => true,
+ 'show_in_quick_edit' => true,
+ 'show_ui' => true,
+ ];
- register_taxonomy("collection", ["product"], $args);
+ register_taxonomy('collection', ['product'], $args);
}
-add_action("init", "enregistre_taxonomie_collection");
+add_action('init', 'enregistre_taxonomie_collection');
diff --git a/web/app/themes/haiku-atelier-2024/src/inc/TraitementInformations.php b/web/app/themes/haiku-atelier-2024/src/inc/TraitementInformations.php
index 0362fd51..2263f084 100755
--- a/web/app/themes/haiku-atelier-2024/src/inc/TraitementInformations.php
+++ b/web/app/themes/haiku-atelier-2024/src/inc/TraitementInformations.php
@@ -1,4 +1,5 @@
array_filter(array: $tableau, callback: fn($chemin_format) => $chemin_format !== false),
- fn($tableau) => array_map(
- array: $tableau,
- callback: fn($chemin_format) => [
- "format" => pathinfo($chemin_format)["extension"],
- "taille" => filesize($chemin_format),
- "url" =>
- pathinfo($url)["dirname"] . "/" . pathinfo($url)["filename"] . "." . pathinfo($chemin_format)["extension"],
- ],
- ),
- );
- usort(array: $formats, callback: fn($a, $b) => $a["taille"] <=> $b["taille"]);
+ // Génère un tableau avec les différents formats valides
+ $formats = pipe(
+ [$avif, $jxl, $webp],
+ fn($tableau) => array_filter(
+ array: $tableau,
+ callback: fn($chemin_format) => false !== $chemin_format,
+ ),
+ fn($tableau) => array_map(
+ array: $tableau,
+ callback: fn($chemin_format) => [
+ 'format' => pathinfo($chemin_format)['extension'],
+ 'taille' => filesize($chemin_format),
+ 'url' =>
+ pathinfo($url)['dirname']
+ . '/'
+ . pathinfo($url)['filename']
+ . '.'
+ . pathinfo($chemin_format)['extension'],
+ ],
+ ),
+ );
+ usort(
+ array: $formats,
+ callback: fn($a, $b) => $a['taille'] <=> $b['taille'],
+ );
- // Construis les balises avec les formats valides
- $sources = "";
- foreach ($formats as $format) {
- $height = $dimensions[0] ?? "";
- $width = $dimensions[1] ?? "";
- $sources .= "\n";
- }
+ // Construis les balises avec les formats valides
+ $sources = '';
+ foreach ($formats as $format) {
+ $height = $dimensions[0] ?? '';
+ $width = $dimensions[1] ?? '';
+ $sources .= "\n";
+ }
- $loading = $lazy ? "lazy" : "eager";
+ $loading = $lazy ? 'lazy' : 'eager';
- return <<
- EOD;
+
+ EOD;
}
/**
- * TODO
+ * TODO.
*
* @param WC_Product $a
* @param WC_Product $b
+ *
* @return int
*/
function tri_variations_par_prix_descendant($a, $b) {
- if ($a->get_price() == $b->get_price()) {
- return 0;
- }
- return $a->get_price() < $b->get_price() ? 1 : -1;
+ if ($a->get_price() === $b->get_price()) {
+ return 0;
+ }
+
+ return $a->get_price() < $b->get_price() ? 1 : -1;
}
/**
@@ -89,96 +103,100 @@ function tri_variations_par_prix_descendant($a, $b) {
* de tableau associatif.
*
* @param WC_Product $produit
- * @return InformationsProduitShop Un tableau avec uniquement les informations pour la Grille de Produits.
+ *
+ * @return InformationsProduitShop un tableau avec uniquement les informations pour la Grille de Produits
*/
function recupere_informations_produit_shop($produit) {
- /** @var int $prix_maximal Le prix maximal du Produit. */
- $prix_maximal = pipe(
- // Récupère les Variations
- $produit->get_children(),
- // Récupère les informations de chaque Variation
- fn($enfants) => array_map(callback: fn($id) => wc_get_product($id), array: $enfants),
- // Trie les Variations par prix descendant
- fn($variations) => array_map(callback: fn($variation) => $variation->get_price(), array: $variations),
- // Récupère le Prix de la Variation la plus chère
- fn($prix) => collect($prix)->max(),
- // Récupère le Prix pour la Variation la plus chère OU le prix du Produit simple
- fn($prix_variation_maximale) => isset($prix_variation_maximale) ? $prix_variation_maximale : $produit->get_price(),
- );
+ /** @var int $prix_maximal Le prix maximal du Produit. */
+ $prix_maximal = pipe(
+ // Récupère les Variations
+ $produit->get_children(),
+ // Récupère les informations de chaque Variation
+ fn($enfants) => array_map(
+ callback: wc_get_product(...),
+ array: $enfants,
+ ),
+ // Trie les Variations par prix descendant
+ fn($variations) => array_map(
+ callback: fn($variation) => $variation->get_price(),
+ array: $variations,
+ ),
+ // Récupère le Prix de la Variation la plus chère
+ fn($prix) => collect($prix)->max(),
+ // Récupère le Prix pour la Variation la plus chère OU le prix du Produit simple
+ fn($prix_variation_maximale) => isset($prix_variation_maximale)
+ ? $prix_variation_maximale
+ : $produit->get_price(),
+ );
- return [
- /* Identifiant du Produit */
- "id" => $produit->get_id(),
- /* Nom affiché du Produit */
- "nom" => $produit->get_name(),
- /* Prix affiché du Produit */
- "prix" => "$prix_maximal",
- /* Photo du Produit affichée par défaut */
- "photo_repos" => genere_balise_img_multiformats(
- get_post_meta($post_id = $produit->get_id(), $key = "_photos_colonne_gauche|||0|value")[0] ?? -1,
- false,
- ),
- /* Photo du Produit affichée au survol de l'image */
- "photo_survol" => genere_balise_img_multiformats(
- get_post_meta($post_id = $produit->get_id(), $key = "_photos_colonne_droite|||0|value")[0] ?? -1,
- true,
- ),
- /* URL du Produit pour les liens vers celui-ci */
- "url" => $produit->get_permalink(),
- ];
+ return [
+ // Identifiant du Produit
+ 'id' => $produit->get_id(),
+ // Nom affiché du Produit
+ 'nom' => $produit->get_name(),
+ // Prix affiché du Produit
+ 'prix' => "{$prix_maximal}",
+ // Photo du Produit affichée par défaut
+ 'photo_repos' => genere_balise_img_multiformats(
+ get_post_meta($post_id = $produit->get_id(), $key = '_photos_colonne_gauche|||0|value')[0] ?? -1,
+ false,
+ ),
+ // Photo du Produit affichée au survol de l'image
+ 'photo_survol' => genere_balise_img_multiformats(
+ get_post_meta($post_id = $produit->get_id(), $key = '_photos_colonne_droite|||0|value')[0] ?? -1,
+ true,
+ ),
+ // URL du Produit pour les liens vers celui-ci
+ 'url' => $produit->get_permalink(),
+ ];
}
-/* Page Produit */
+// Page Produit
/**
* Retourne un tableau associatif des informations affichées sur la page Produit depuis les données brutes d'un Produit.
*
* @param mixed $donnees_produit
- * @return mixed
*/
function recupere_informations_produit_page_produit($donnees_produit): mixed {
- return [
- /* Attributs du Produit */
- "attributs" => wc_get_product()->get_attributes(),
- /* Catégorie du Produit */
- "categorie" => pipe(
- $donnees_produit->get_id(),
- fn($id) => wc_get_product_category_list($id),
- fn($categorie) => strtolower($categorie),
- ),
- // Slug de la Collection - Peut ne pas avoir été défini
- "collection" => get_the_terms($donnees_produit->get_id(), "collection")[0]?->slug ?? "",
- /* Détails (Description) du Produit */
- "details" => wpautop($donnees_produit->get_description()),
- /* Identifiant du Produit */
- "id" => $donnees_produit->get_id(),
- /* Nom affiché du Produit */
- "nom" => $donnees_produit->get_name(),
- /* Prix affiché du Produit */
- "prix" => $donnees_produit->get_price(),
- "photos_colonne_gauche" => array_map(
- callback: "genere_balise_img_multiformats",
- array: get_post_meta($post_id = $donnees_produit->get_id(), $key = "_photos_colonne_gauche|||0|value"),
- ),
- "photos_colonne_droite" => array_map(
- callback: "genere_balise_img_multiformats",
- array: carbon_get_the_post_meta("photos_colonne_droite"),
- ),
- "photo_repos" => genere_balise_img_multiformats(
- get_post_meta($post_id = $donnees_produit->get_id(), $key = "_photos_colonne_gauche|||0|value")[0] ?? -1,
- false,
- ),
- "photo_survol" => genere_balise_img_multiformats(
- get_post_meta($post_id = $donnees_produit->get_id(), $key = "_photos_colonne_droite|||0|value")[0] ?? -1,
- true,
- ),
- /* Slug du Produit */
- "slug" => $donnees_produit->get_slug(),
- /* Variations du Produit */
- "variations_ids" => $donnees_produit->get_children(),
- /* URL du Produit */
- "url" => $donnees_produit->get_permalink(),
- ];
+ return [
+ // Attributs du Produit
+ 'attributs' => wc_get_product()->get_attributes(),
+ // Catégorie du Produit
+ 'categorie' => pipe($donnees_produit->get_id(), wc_get_product_category_list(...), strtolower(...)),
+ // Slug de la Collection - Peut ne pas avoir été défini
+ 'collection' => get_the_terms($donnees_produit->get_id(), 'collection')[0]->slug ?? '',
+ // Détails (Description) du Produit
+ 'details' => wpautop($donnees_produit->get_description()),
+ // Identifiant du Produit
+ 'id' => $donnees_produit->get_id(),
+ // Nom affiché du Produit
+ 'nom' => $donnees_produit->get_name(),
+ // Prix affiché du Produit
+ 'prix' => $donnees_produit->get_price(),
+ 'photos_colonne_gauche' => array_map(
+ callback: 'genere_balise_img_multiformats',
+ array: get_post_meta($post_id = $donnees_produit->get_id(), $key = '_photos_colonne_gauche|||0|value'),
+ ),
+ 'photos_colonne_droite' => array_map(
+ callback: 'genere_balise_img_multiformats',
+ array: carbon_get_the_post_meta('photos_colonne_droite'),
+ ),
+ 'photo_repos' => genere_balise_img_multiformats(
+ get_post_meta($post_id = $donnees_produit->get_id(), $key = '_photos_colonne_gauche|||0|value')[0] ?? -1,
+ false,
+ ),
+ 'photo_survol' => genere_balise_img_multiformats(
+ get_post_meta($post_id = $donnees_produit->get_id(), $key = '_photos_colonne_droite|||0|value')[0] ?? -1,
+ true,
+ ),
+ // Slug du Produit
+ 'slug' => $donnees_produit->get_slug(),
+ // Variations du Produit
+ 'variations_ids' => $donnees_produit->get_children(),
+ // URL du Produit
+ 'url' => $donnees_produit->get_permalink(),
+ ];
}
/**
@@ -188,49 +206,32 @@ function recupere_informations_produit_page_produit($donnees_produit): mixed {
* Pour faciliter l'usage avec `array_map`, utilise une fonction avec curryfication.
*
* @param string $slug_collection
+ *
* @return mixed
*/
function recupere_produits_meme_collection($slug_collection) {
- /**
- * @param int $id_produit
- */
- return function ($id_produit) use ($slug_collection) {
- return wc_get_products([
- "exclude" => [$id_produit],
- "limit" => 4,
- "order" => "DESC",
- "orderby" => "date",
- "status" => "publish",
- "tax_query" => [
- [
- "taxonomy" => "collection",
- "field" => "slug",
- "terms" => $slug_collection,
- ],
- ],
+ // @param int $id_produit
+ return fn($id_produit) => wc_get_products([
+ 'exclude' => [$id_produit],
+ 'limit' => 4,
+ 'order' => 'DESC',
+ 'orderby' => 'date',
+ 'status' => 'publish',
+ 'tax_query' => [['taxonomy' => 'collection', 'field' => 'slug', 'terms' => $slug_collection]],
]);
- };
}
-/* Page Panier */
+// Page Panier
/**
* @param mixed $attributs_produit
+ *
* @return mixed
*/
function recupere_et_formate_attributs_produit($attributs_produit) {
- return [
- "taille" => [
- "nom" => "Size",
- "valeur" => $attributs_produit["pa_size"] ?? false,
- ],
- "pierre" => [
- "nom" => "Stone",
- "valeur" => $attributs_produit["pa_stone"] ?? false,
- ],
- "cote" => [
- "nom" => "Side",
- "valeur" => $attributs_produit["pa_side"] ?? false,
- ],
- ];
+ return [
+ 'taille' => ['nom' => 'Size', 'valeur' => $attributs_produit['pa_size'] ?? false],
+ 'pierre' => ['nom' => 'Stone', 'valeur' => $attributs_produit['pa_stone'] ?? false],
+ 'cote' => ['nom' => 'Side', 'valeur' => $attributs_produit['pa_side'] ?? false],
+ ];
}
diff --git a/web/app/themes/haiku-atelier-2024/src/sass/abstracts/_variables.scss b/web/app/themes/haiku-atelier-2024/src/sass/abstracts/_variables.scss
index 220cdf42..d4879ba4 100755
--- a/web/app/themes/haiku-atelier-2024/src/sass/abstracts/_variables.scss
+++ b/web/app/themes/haiku-atelier-2024/src/sass/abstracts/_variables.scss
@@ -36,7 +36,7 @@
--menu-categories-produits-hauteur: calc(var(--espace-m) * 2 + 1rlh);
// 3 lignes * taille de la police + marges internes verticales
- --pied-de-page-hauteur: calc(0.8rem * 1.5 * 3 + var(--espace-m) * 2);
+ --pied-de-page-hauteur: calc(0.8rem * 1.5 * 3 + var(--espace-s) * 2);
--contenu-page-hauteur-minimale-sans-categories: calc(
100svh - var(--en-tete-hauteur) - var(--pied-de-page-hauteur)
);
@@ -46,6 +46,7 @@
);
/* Espacements */
+ --espace-2xs: 0.1rem; // 4px;
--espace-xs: 0.25rem; // 4px;
--espace-s: 0.5rem; // 8px
--espace-m: 1rem; // 16px
diff --git a/web/app/themes/haiku-atelier-2024/src/sass/layouts/_en-tete.scss b/web/app/themes/haiku-atelier-2024/src/sass/layouts/_en-tete.scss
index ce61fa02..0f657e6c 100755
--- a/web/app/themes/haiku-atelier-2024/src/sass/layouts/_en-tete.scss
+++ b/web/app/themes/haiku-atelier-2024/src/sass/layouts/_en-tete.scss
@@ -25,13 +25,13 @@
border-bottom: 1px solid var(--couleur-noir);
background: var(--couleur-gris);
+ picture, img {
+ background: transparent;
+ }
+
.logo {
width: var(--en-tete-logo-longueur);
- picture, img {
- background: transparent;
- }
-
img {
width: 100%;
height: 40px;
@@ -42,12 +42,6 @@
image-rendering: crisp-edges;
shape-rendering: geometricprecision;
}
-
- button {
- display: block;
- align-content: center;
- width: 100%;
- }
}
/* TODO: Déplacer au sein d'un Composant ? */
@@ -142,8 +136,9 @@
*/
a {
min-width: 10ch; /* 1 */
- font-size: 1.1rem;
text-transform: lowercase;
+ padding-block: var(--espace-2xs);
+ padding-inline: var(--espace-s);
&.lien-compte {
border-color: transparent;
@@ -154,4 +149,31 @@
}
}
}
+
+ .conteneur {
+ display: flex;
+ column-gap: var(--espace-m);
+ }
+
+ .bouton-menu-mobile {
+ --hauteur-bouton-menu: 22px;
+ display: none;
+ align-content: center;
+
+ img {
+ height: var(--hauteur-bouton-menu);
+ object-fit: contain;
+ image-rendering: crisp-edges;
+ shape-rendering: geometricprecision;
+ }
+
+ // Affiche sur petites tailles d'écran.
+ @media (width <= 1000px) {
+ display: block;
+ }
+ }
+
+ @media (width <= 600px) {
+ --en-tete-marges-internes-ligne: var(--espace-l);
+ }
}
diff --git a/web/app/themes/haiku-atelier-2024/src/sass/layouts/_pied-de-page.scss b/web/app/themes/haiku-atelier-2024/src/sass/layouts/_pied-de-page.scss
index 5696d720..331a8d10 100755
--- a/web/app/themes/haiku-atelier-2024/src/sass/layouts/_pied-de-page.scss
+++ b/web/app/themes/haiku-atelier-2024/src/sass/layouts/_pied-de-page.scss
@@ -7,7 +7,7 @@
place-items: center;
max-width: 100vw;
height: var(--pied-de-page-hauteur);
- padding: var(--espace-m);
+ padding: var(--espace-s) var(--espace-m);
border-top: 1px solid var(--couleur-noir);
font-size: 0.8rem;
background: var(--couleur-jaune);
diff --git a/web/app/themes/haiku-atelier-2024/src/scripts/journalisation.ts b/web/app/themes/haiku-atelier-2024/src/scripts/journalisation.ts
old mode 100644
new mode 100755
diff --git a/web/app/themes/haiku-atelier-2024/src/scripts/lib/arrays.ts b/web/app/themes/haiku-atelier-2024/src/scripts/lib/arrays.ts
old mode 100644
new mode 100755
diff --git a/web/app/themes/haiku-atelier-2024/src/scripts/lib/safe-arrays.ts b/web/app/themes/haiku-atelier-2024/src/scripts/lib/safe-arrays.ts
old mode 100644
new mode 100755
diff --git a/web/app/themes/haiku-atelier-2024/src/scripts/page-panier/scripts-page-panier-elements.ts b/web/app/themes/haiku-atelier-2024/src/scripts/page-panier/scripts-page-panier-elements.ts
old mode 100644
new mode 100755
diff --git a/web/app/themes/haiku-atelier-2024/src/scripts/page-panier/scripts-page-panier-local-storage.ts b/web/app/themes/haiku-atelier-2024/src/scripts/page-panier/scripts-page-panier-local-storage.ts
old mode 100644
new mode 100755
diff --git a/web/app/themes/haiku-atelier-2024/taxonomy-product_cat.php b/web/app/themes/haiku-atelier-2024/taxonomy-product_cat.php
index 992b73bc..0feb6962 100755
--- a/web/app/themes/haiku-atelier-2024/taxonomy-product_cat.php
+++ b/web/app/themes/haiku-atelier-2024/taxonomy-product_cat.php
@@ -1,4 +1,5 @@
$informations_produits Les informations brutes des Produits. */
$informations_produits = wc_get_products([
- "category" => [get_queried_object()?->slug],
- "limit" => 12,
- "order" => "DESC",
- "orderby" => "date",
- "status" => "publish",
+ 'category' => [get_queried_object()?->slug],
+ 'limit' => 12,
+ 'order' => 'DESC',
+ 'orderby' => 'date',
+ 'status' => 'publish',
]);
+
/** @var InformationsProduitShop $produits Les informations strictement nécessaires pour la grille des Produits. */
-$produits = array_map(callback: "recupere_informations_produit_shop", array: $informations_produits);
-$contexte["produits"] = $produits;
-$id_categorie_produits = array_shift($informations_produits)?->get_category_ids()[0] ?? "";
-$contexte["id_categorie_produits"] = $id_categorie_produits;
+$produits = array_map(
+ callback: 'recupere_informations_produit_shop',
+ array: $informations_produits,
+);
+$contexte['produits'] = $produits;
+$id_categorie_produits = array_shift($informations_produits)?->get_category_ids()[0] ?? '';
+$contexte['id_categorie_produits'] = $id_categorie_produits;
/**
* Charge les Scripts nécessaires pour la page d'Archive.
*/
function charge_scripts_page_archive_produits(): void {
- wp_enqueue_style(
- handle: "haiku-atelier-2024-styles-page-boutique",
- src: get_template_directory_uri() . "/assets/css/pages/page-boutique.css",
- deps: [],
- ver: filemtime(get_template_directory() . "/assets/css/pages/page-boutique.css"),
- media: "all",
- );
- wp_enqueue_script_module(
- id: "haiku-atelier-2024-scripts-page-boutique",
- src: get_template_directory_uri() . "/assets/js/scripts-page-boutique.js",
- deps: [],
- version: filemtime(get_template_directory() . "/assets/js/scripts-page-boutique.js"),
- );
- wp_enqueue_script_module(
- id: "haiku-atelier-2024-scripts-menu-categories",
- src: get_template_directory_uri() . "/assets/js/scripts-menu-categories.js",
- deps: [],
- version: filemtime(get_template_directory() . "/assets/js/scripts-menu-categories.js"),
- );
+ wp_enqueue_style(
+ handle: 'haiku-atelier-2024-styles-page-boutique',
+ src: get_template_directory_uri() . '/assets/css/pages/page-boutique.css',
+ deps: [],
+ ver: filemtime(get_template_directory() . '/assets/css/pages/page-boutique.css'),
+ media: 'all',
+ );
+ wp_enqueue_script_module(
+ id: 'haiku-atelier-2024-scripts-page-boutique',
+ src: get_template_directory_uri() . '/assets/js/scripts-page-boutique.js',
+ deps: [],
+ version: filemtime(get_template_directory() . '/assets/js/scripts-page-boutique.js'),
+ );
+ wp_enqueue_script_module(
+ id: 'haiku-atelier-2024-scripts-menu-categories',
+ src: get_template_directory_uri() . '/assets/js/scripts-menu-categories.js',
+ deps: [],
+ version: filemtime(get_template_directory() . '/assets/js/scripts-menu-categories.js'),
+ );
}
-add_action("wp_enqueue_scripts", "charge_scripts_page_archive_produits");
+
+add_action('wp_enqueue_scripts', 'charge_scripts_page_archive_produits');
// Rendu
-Timber::render(filenames: $modeles, data: $contexte);
+Timber::render(
+ filenames: $modeles,
+ data: $contexte,
+);
diff --git a/web/app/themes/haiku-atelier-2024/views/404.twig b/web/app/themes/haiku-atelier-2024/views/404.twig
index 50ef1e9e..c4de500a 100755
--- a/web/app/themes/haiku-atelier-2024/views/404.twig
+++ b/web/app/themes/haiku-atelier-2024/views/404.twig
@@ -1,4 +1,4 @@
-{% extends "base.twig" %}
+{% extends 'base.twig' %}
{% block contenu %}
{{
- images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/about/haikuabout", "", dimensions_image[0], dimensions_image[1], "")
+ images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/about/haikuabout", '', dimensions_image[0], dimensions_image[1], '')
}}
{# Épingles #}
@@ -20,6 +20,7 @@

@@ -34,6 +35,7 @@

@@ -48,6 +50,7 @@

@@ -62,6 +65,7 @@

@@ -76,6 +80,7 @@

@@ -90,6 +95,7 @@

@@ -107,6 +113,7 @@

@@ -131,6 +138,7 @@

@@ -157,6 +165,7 @@

@@ -184,6 +193,7 @@

@@ -210,6 +220,7 @@

@@ -240,6 +251,7 @@

diff --git a/web/app/themes/haiku-atelier-2024/views/accueil.twig b/web/app/themes/haiku-atelier-2024/views/accueil.twig
index 391ab7f2..4c2b1efa 100755
--- a/web/app/themes/haiku-atelier-2024/views/accueil.twig
+++ b/web/app/themes/haiku-atelier-2024/views/accueil.twig
@@ -1,5 +1,5 @@
-{% extends "base.twig" %}
-{% import "macros/images.twig" as images %}
+{% extends 'base.twig' %}
+{% import 'macros/images.twig' as images %}
{% block contenu %}
@@ -141,7 +143,7 @@
tabindex="-1"
>
{{
- images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll2", "", 903, 1080, "image-scroll2")
+ images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll2", '', 903, 1080, 'image-scroll2')
}}
@@ -152,7 +154,7 @@
tabindex="-1"
>
{{
- images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll3", "", 903, 1080, "image-scroll3")
+ images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll3", '', 903, 1080, 'image-scroll3')
}}
@@ -163,7 +165,7 @@
tabindex="-1"
>
{{
- images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll4", "", 903, 1080, "image-scroll4")
+ images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll4", '', 903, 1080, 'image-scroll4')
}}
@@ -174,7 +176,7 @@
tabindex="-1"
>
{{
- images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll5", "", 903, 1080, "image-scroll5")
+ images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll5", '', 903, 1080, 'image-scroll5')
}}
@@ -185,7 +187,7 @@
tabindex="-1"
>
{{
- images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll6", "", 903, 1080, "image-scroll6")
+ images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll6", '', 903, 1080, 'image-scroll6')
}}
@@ -196,7 +198,7 @@
tabindex="-1"
>
{{
- images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll7", "", 903, 1080, "image-scroll7")
+ images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll7", '', 903, 1080, 'image-scroll7')
}}
@@ -207,7 +209,7 @@
tabindex="-1"
>
{{
- images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll8", "", 903, 1080, "image-scroll8")
+ images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll8", '', 903, 1080, 'image-scroll8')
}}
@@ -218,7 +220,7 @@
tabindex="-1"
>
{{
- images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll9", "", 903, 1080, "image-scroll9")
+ images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll9", '', 903, 1080, 'image-scroll9')
}}
@@ -229,7 +231,7 @@
tabindex="-1"
>
{{
- images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll10", "", 903, 1080, "image-scroll10")
+ images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll10", '', 903, 1080, 'image-scroll10')
}}
@@ -240,7 +242,7 @@
tabindex="-1"
>
{{
- images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll11", "", 903, 1080, "image-scroll11")
+ images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll11", '', 903, 1080, 'image-scroll11')
}}
@@ -251,7 +253,7 @@
tabindex="-1"
>
{{
- images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll12", "", 903, 1080, "image-scroll12")
+ images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll12", '', 903, 1080, 'image-scroll12')
}}
@@ -262,7 +264,7 @@
tabindex="-1"
>
{{
- images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll13", "", 903, 1080, "image-scroll13")
+ images.genere_source_img_multi_formats("#{ site.theme.link }/assets/img/storytelling/scroll13", '', 903, 1080, 'image-scroll13')
}}
diff --git a/web/app/themes/haiku-atelier-2024/views/base.twig b/web/app/themes/haiku-atelier-2024/views/base.twig
index 436930cf..f8946193 100755
--- a/web/app/themes/haiku-atelier-2024/views/base.twig
+++ b/web/app/themes/haiku-atelier-2024/views/base.twig
@@ -2,7 +2,7 @@
{# #}
{% block conteneur_html_head %}
- {% include "parts/html-head.twig" %}
+ {{ include('parts/html-head.twig') }}
{% block head %}
{% endblock head %}
@@ -13,7 +13,7 @@
data-langue="{{ langue_courante }}"
>
{# En-tête #}
- {% include "parts/en-tete.twig" %}
+ {{ include('parts/en-tete.twig') }}
{# Contenu #}
{% block contenu %}
@@ -40,9 +40,9 @@
{# Pied de page #}
{% block footer %}
- {% include "parts/pied-de-page.twig" %}
+ {{ include('parts/pied-de-page.twig') }}
- {{ function("wp_footer") }}
+ {{ function('wp_footer') }}
{% endblock footer %}
diff --git a/web/app/themes/haiku-atelier-2024/views/boutique.twig b/web/app/themes/haiku-atelier-2024/views/boutique.twig
index f1344cd7..f9c1f45f 100755
--- a/web/app/themes/haiku-atelier-2024/views/boutique.twig
+++ b/web/app/themes/haiku-atelier-2024/views/boutique.twig
@@ -1,4 +1,4 @@
-{% extends "base.twig" %}
+{% extends 'base.twig' %}
{% block head %}
{% endif %}
- {{ function("wp_head") }}
+ {{ function('wp_head') }}
diff --git a/web/app/themes/haiku-atelier-2024/views/parts/menu-categories-produits.twig b/web/app/themes/haiku-atelier-2024/views/parts/menu-categories-produits.twig
index 9db8839f..b429c85f 100755
--- a/web/app/themes/haiku-atelier-2024/views/parts/menu-categories-produits.twig
+++ b/web/app/themes/haiku-atelier-2024/views/parts/menu-categories-produits.twig
@@ -5,8 +5,10 @@
id="menu-categories-produits"
>
{% for cle, pays in pays_livraison %}
@@ -267,8 +267,8 @@
>
{% for cle, pays in pays_livraison %}
diff --git a/web/app/themes/haiku-atelier-2024/views/parts/pages/panier/panneau-panier.twig b/web/app/themes/haiku-atelier-2024/views/parts/pages/panier/panneau-panier.twig
index e6de36b7..ae14523d 100755
--- a/web/app/themes/haiku-atelier-2024/views/parts/pages/panier/panneau-panier.twig
+++ b/web/app/themes/haiku-atelier-2024/views/parts/pages/panier/panneau-panier.twig
@@ -40,12 +40,13 @@