Get a product attributes label.
Obtenir une étiquette d'attributs de produit.
$label, $name, $product
Sortie :
@param string $name Attribute name. @param WC_Product $product Product data. @return string
// Personnaliser le label des attributs
add_filter('woocommerce_attribute_label', 'label_attribut_personnalise', 10, 3);
function label_attribut_personnalise($label, $name, $product) {
// Ajouter des icônes selon l'attribut
if ($name === 'pa_couleur') {
return '🎨 ' . $label;
}
if ($name === 'pa_taille') {
return '📏 ' . $label;
}
return $label;
}
Chargement des actualités...