From 4960af34aaeac804e03bb3bbc4db142b5d3f5a1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demarle?= Date: Tue, 20 Jun 2017 14:25:23 +0200 Subject: [PATCH] Add an action before importing a row --- includes/import/abstract-wc-product-importer.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/import/abstract-wc-product-importer.php b/includes/import/abstract-wc-product-importer.php index 0c7326bb07d..46aeba36c5d 100644 --- a/includes/import/abstract-wc-product-importer.php +++ b/includes/import/abstract-wc-product-importer.php @@ -194,6 +194,8 @@ abstract class WC_Product_Importer implements WC_Importer_Interface { */ protected function process_item( $data ) { try { + do_action( 'woocommerce_product_import_before_process_item', $data ); + // Get product ID from SKU if created during the importation. if ( empty( $data['id'] ) && ! empty( $data['sku'] ) && ( $product_id = wc_get_product_id_by_sku( $data['sku'] ) ) ) { $data['id'] = $product_id;