woocommerce_save_product_cogs_value

FILTER woocommerce\includes\data-stores\class-wc-product-data-store-cpt.php (ligne 766) github
Filter to customize the Cost of Goods Sold value that gets saved for a given product, or to suppress the saving of the value (so that custom storage can be used).

Paramètres

Entrée :
$cogs_value, $product
Sortie :
@param float|null|false $cogs_value The value to be written to the database. If returned as false, nothing will be written.
@param WC_Product $product The product for which the value is being saved.

Utilisation

// Modifier la valeur avec le filtre 'woocommerce_save_product_cogs_value'
add_filter('woocommerce_save_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...