Filters the number of minutes an order should reserve stock for. This hook allows the number of minutes that stock in an order should be reserved for to be filtered, useful for third party developers to increase/reduce the number of minutes if the order meets certain criteria, or to exclude an order from stock reservation using a zero value.
$minutes, $order
Sortie :
@param int $minutes How long to reserve stock for the order in minutes. Defaults to woocommerce_hold_stock_minutes or 10 if block checkout entry. @param \WC_Order $order Order object.
// Modifier la valeur avec le filtre 'woocommerce_order_hold_stock_minutes'
add_filter('woocommerce_order_hold_stock_minutes', 'ma_fonction_filtre', 10, 1);
function ma_fonction_filtre($minutes) {
// Modifier la valeur
return $minutes;
}
Chargement des actualités...