fonc: prend en compte un nouvel attribut de Produit

This commit is contained in:
gcch 2026-04-27 11:42:47 +02:00
commit 016c7466b3
2 changed files with 6 additions and 6 deletions

View file

@ -41,12 +41,11 @@ $variations_produit = pipe(
'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_giftcard-amount') => $variation->get_attribute( 'pa_giftcard-amount', ),
'' !== $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'),
'' !== $variation->get_attribute('pa_giftcard-amount') => $variation->get_attribute(
'pa_giftcard-amount',
),
'' !== $variation->get_attribute('pa_stone') => $variation->get_attribute('pa_stone'),
'' !== $variation->get_attribute('pa_material-workshop') => $variation->get_attribute('pa_material-workshop'),
default => '',
},
'prix' => $variation->get_price(),

View file

@ -222,8 +222,9 @@ function recupere_produits_meme_collection(string $slug_collection): mixed {
function recupere_et_formate_attributs_produit(mixed $attributs_produit): mixed {
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],
'materiel' => ['nom' => 'Material', 'valeur' => $attributs_produit['pa_material-workshop'] ?? false],
'pierre' => ['nom' => 'Stone', 'valeur' => $attributs_produit['pa_stone'] ?? false],
'taille' => ['nom' => 'Size', 'valeur' => $attributs_produit['pa_size'] ?? false],
];
}