woocommerce_save_order_cogs_value

FILTER woocommerce\src\Internal\DataStores\Orders\OrdersTableDataStore.php (ligne 2108) github
Filter to customize the Cost of Goods Sold value that gets saved for a given order, or to suppress the saving of the value (so that custom storage can be used).

Paramètres

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

Utilisation

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