woocommerce_load_product_cogs_value

FILTER woocommerce\includes\data-stores\class-wc-product-data-store-cpt.php (ligne 516) github
Filter to customize the Cost of Goods Sold value that gets loaded for a given product.

Paramètres

Entrée :
$cogs_value, $product
Sortie :
@param float $cogs_value The value as read from the database.
@param WC_Product $product The product for which the value is being loaded.

Utilisation

// Modifier la valeur avec le filtre 'woocommerce_load_product_cogs_value'
add_filter('woocommerce_load_product_cogs_value', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre($cogs_value) {
    // Modifier la valeur
    return $cogs_value;
}

Actualités

Chargement des actualités...