woocommerce_variable_product_sync_data

ACTION woocommerce\includes\class-wc-product-variable.php (ligne 643) github
Sync a variable product with its children. These sync functions sync upwards (from child to parent) when the variation is saved.

Paramètres

Entrée :
$product
Sortie :
@param WC_Product|int $product Product object or ID for which you wish to sync.
@param bool           $save If true, the product object will be saved to the DB before returning it.
@return WC_Product Synced product object.

Utilisation

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

function ma_fonction_personnalisee($product) {
    // Votre code ici
    error_log('Hook woocommerce_variable_product_sync_data déclenché');
}

Actualités

Chargement des actualités...