woocommerce_pre_payment_complete

ACTION woocommerce\includes\class-wc-order.php (ligne 142) github
When a payment is complete this function is called. Most of the time this should mark an order as 'processing' so that admin can process/post the items. If the cart contains only downloadable items then the order is 'completed' since the admin needs to take no action. Stock levels are reduced at this point. Sales are also recorded for products. Finally, record the date of payment.

Paramètres

Entrée :
$this->get_id(
Sortie :
@param string $transaction_id Optional transaction id to store in post meta.
@return bool success

Utilisation

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

function ma_fonction_personnalisee($this->get_id() {
    // Votre code ici
    error_log('Hook woocommerce_pre_payment_complete déclenché');
}

Actualités

Chargement des actualités...