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.
$this->get_id(
Sortie :
@param string $transaction_id Optional transaction id to store in post meta. @return bool success
// 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é');
}
Chargement des actualités...