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).
$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.
// 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;
}
Chargement des actualités...