Filter to manipulate (add/modify/remove) attributes in the HTML code of the generated add to cart button.
$attributes, $product
Sortie :
@param array $attributes An associative array containing default HTML attributes of the add to cart button. @param WC_Product $product The WC_Product instance of the product that will be added to the cart once the button is pressed. @return array Returns an associative array derived from the default array passed as an argument and added the extra HTML attributes.
// Modifier la valeur avec le filtre 'woocommerce_blocks_product_grid_add_to_cart_attributes'
add_filter('woocommerce_blocks_product_grid_add_to_cart_attributes', 'ma_fonction_filtre', 10, 1);
function ma_fonction_filtre($attributes) {
// Modifier la valeur
return $attributes;
}
Chargement des actualités...