fonc: prend en compte un nouvel attribut de Produit
This commit is contained in:
parent
b3da4c2cb3
commit
016c7466b3
2 changed files with 6 additions and 6 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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],
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue