New field “GTIN, UPC, EAN, or ISBN”, not able to import

[ad_1]

Hi all,

When using the built-in WooCommerce importer/exporter, the new field “GTIN, UPC, EAN, or ISBN” is not included. A snippet has been provided for export that works fine, see below: (Courtesy of @mujuonly and @serafinnyc)

add_filter('woocommerce_product_export_column_names', 'add_custom_gtin_export_column');
function add_custom_gtin_export_column($columns) {
$columns['global_unique_id'] = 'GTIN/UPC/EAN/ISBN';
return $columns;
}

add_filter('woocommerce_product_export_product_row', 'add_custom_gtin_export_row', 10, 3);
function add_custom_gtin_export_row($row, $product, $product_id) {
$gtin_value = get_post_meta($product_id, '_global_unique_id', true);

$row['global_unique_id'] = !empty($gtin_value) ? $gtin_value : '';

return $row;
}

I haven’t been able to tweak this to work also for import. Kindly asking for assistance resolving the issue.

Many thanks in advance!
Christian P.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer