Skip to main content
WB2
récupération de val...
 
Notifications
Retirer tout

récupération de valeur d'attribut d'un produit variable dans une commande

1 Publications
1 Utilisateurs
0 Reactions
0 Vu
(@infrafast)
Publications: 1
New Member
Début du sujet
 
[#5398]

Bonjour, je dois récupérer la valeur choisis par l'utilisateur dans une commande de produit variable, voila mon code:

 

$attributes = $product->get_attributes();

$variation_names = array();

if( $attributes ){

foreach ( $attributes as $key => $value) {

$variation_key =  end(explode('-', $key));

$variation_names[] = ucfirst($variation_key) .' : '. $value;

error_log(print_r(array("VARIATIONNAMES",$variation_names), true));

}

}

 

Malheureusement la valeur de pa_module est vide....

[04-May-2021 07:59:21 UTC] Array

(

[0] => VARIATIONNAMES

[1] => Array

(

[0] => pa_module :

)

 

)

 

Je vous remercie pour votre aide,

Thomas

 


 
Posté : 04/05/2021 10:20 am
Share: