woocommerce_download_product

ACTION woocommerce\includes\class-wc-download-handler.php (ligne 129) github
Filter download filepath.
traduction française
Filtrer le chemin d'accès au fichier de téléchargement.

Paramètres

Entrée :
$download->get_user_email(
Sortie :
@param string $file_path File path.
@param string $email_address Email address.
@param WC_Order|bool $order Order object or false.
@param WC_Product $product Product object.
@param WC_Customer_Download $download Download data.

Utilisation

Gérer le téléchargement d'un produit

Contrôler l'accès aux fichiers téléchargeables

products
// Action sur téléchargement
add_action('woocommerce_download_product', 'tracking_telechargement', 10, 6);

function tracking_telechargement($user_email, $order_key, $product_id, $user_id, $download_id, $order_id) {
    // Logger le téléchargement
    error_log("Téléchargement produit #{$product_id} par user #{$user_id}");
    
    // Tracking analytics
    // Limiter le nombre de téléchargements
}

Actualités

Chargement des actualités...