Add order item via AJAX. This is refactored for better unit testing.
$item_id, $item, $order
Sortie :
@param int $order_id ID of order to add items to. @param string|array $items Existing items in order. Empty string if no items to add. @param array $items_to_add Array of items to add. @return array Fragments to render and notes HTML.
// Ajouter une fonction au hook action 'woocommerce_ajax_add_order_item_meta'
add_action('woocommerce_ajax_add_order_item_meta', 'ma_fonction_personnalisee', 10, 1);
function ma_fonction_personnalisee($item_id, $item, $order) {
// Votre code ici
error_log('Hook woocommerce_ajax_add_order_item_meta déclenché');
}
Chargement des actualités...