Sync a variable product with its children. These sync functions sync upwards (from child to parent) when the variation is saved.
$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.
// 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é');
}
Chargement des actualités...