Filter to customize the "Cost of Goods Sold value is additive" flag that gets saved for a given variable product, or to suppress the saving of the flag (so that custom storage can be used) if null is returned. Note that returning null will suppress any database access (for either saving the flag or deleting it).
$cogs_value_is_additive, $product
Sortie :
@param bool|null $cogs_value_is_additive The flag to be written to the database. If null is returned nothing will be written or deleted. @param WC_Product $product The product for which the flag is being saved.
// Modifier la valeur avec le filtre 'woocommerce_save_product_cogs_is_additive_flag'
add_filter('woocommerce_save_product_cogs_is_additive_flag', 'ma_fonction_filtre', 10, 1);
function ma_fonction_filtre($cogs_value_is_additive) {
// Modifier la valeur
return $cogs_value_is_additive;
}
Chargement des actualités...