Filter to customize the Cost of Goods Sold value that gets saved for a given order item, or to suppress the saving of the value (so that custom storage can be used).
$cogs_value, $item
Sortie :
@param float|null $cogs_value The value to be written to the database. If returned as null, nothing will be written. @param WC_Order_Item $item The order item for which the value is being saved.
// Modifier la valeur avec le filtre 'woocommerce_save_order_item_cogs_value'
add_filter('woocommerce_save_order_item_cogs_value', 'ma_fonction_filtre', 10, 1);
function ma_fonction_filtre($cogs_value) {
// Modifier la valeur
return $cogs_value;
}
Chargement des actualités...