Action to signal that the value of 'stock_quantity' for a product is about to change.
wc_get_product( $change['product']->get_id(
Sortie :
@param int $product The product whose stock is about to change.
// Ajouter une fonction au hook action 'woocommerce_low_stock'
add_action('woocommerce_low_stock', 'ma_fonction_personnalisee', 10, 1);
function ma_fonction_personnalisee(wc_get_product( $change['product']->get_id() {
// Votre code ici
error_log('Hook woocommerce_low_stock déclenché');
}
Chargement des actualités...