woocommerce_variation_set_stock

ACTION woocommerce\includes\data-stores\class-wc-product-data-store-cpt.php (ligne 846) github
Action to signal that the value of 'stock_quantity' for a variation has changed.

Paramètres

Entrée :
$product
Sortie :
@param WC_Product $product The variation whose stock has changed.

Utilisation

// Ajouter une fonction au hook action 'woocommerce_variation_set_stock'
add_action('woocommerce_variation_set_stock', 'ma_fonction_personnalisee', 10, 1);

function ma_fonction_personnalisee($product) {
    // Votre code ici
    error_log('Hook woocommerce_variation_set_stock déclenché');
}

Actualités

Chargement des actualités...