woocommerce_blocks_product_grid_add_to_cart_attributes

FILTER woocommerce\src\Blocks\BlockTypes\AbstractProductGrid.php (ligne 681) github
Filter to manipulate (add/modify/remove) attributes in the HTML code of the generated add to cart button.

Paramètres

Entrée :
$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.

Utilisation

// 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;
}

Actualités

Chargement des actualités...