woocommerce_store_api_checkout_update_order_meta

ACTION woocommerce\src\StoreApi\Routes\V1\Checkout.php (ligne 691) github
Fires when the Checkout Block/Store API updates an order's meta data. This hook gives extensions the chance to add or update meta data on the $order. Throwing an exception from a callback attached to this action will make the Checkout Block render in a warning state, effectively preventing checkout. This is similar to existing core hook woocommerce_checkout_update_order_meta. We're using a new action: - To keep the interface focused (only pass $order, not passing request data). - This also explicitly indicates these orders are from checkout block/StoreAPI.

Paramètres

Entrée :
$this->order
Sortie :
@param \WC_Order $order Order object.

Utilisation

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

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

Actualités

Chargement des actualités...