Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • // Add the custom column to the export columns
    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;
    }

    // Populate the custom column with data for export
    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;
    }

    // Add the custom column to the WooCommerce importer mapping options
    add_filter('woocommerce_csv_product_import_mapping_options', 'add_custom_gtin_import_mapping_option');
    function add_custom_gtin_import_mapping_option($options) {
    $options['global_unique_id'] = 'GTIN/UPC/EAN/ISBN';
    return $options;
    }

    // Map the custom column to the meta key during import
    add_filter('woocommerce_csv_product_import_mapping_default_columns', 'map_custom_gtin_import_column');
    function map_custom_gtin_import_column($columns) {
    $columns['GTIN/UPC/EAN/ISBN'] = 'global_unique_id';
    return $columns;
    }

    // Handle the import of the custom column
    add_action('woocommerce_product_import_inserted_product_object', 'save_custom_gtin_during_import', 10, 2);
    function save_custom_gtin_during_import($product, $data) {
    if (!empty($data['global_unique_id'])) {
    $product->update_meta_data('_global_unique_id', sanitize_text_field($data['global_unique_id']));
    $product->save(); // Save changes to the product object
    }
    }

    Here is the fix:
    “Fisrt I will suggest you Download the latest WordPress 2.1.3 and older versions may have more bugs..
    Just remember to go to your tools tab in your IE browser then go to security tab open, set level to medium then go to and open the privacy tab and then set it to medium if on high login will fail..
    Hope this will help you

    Mark Lane
    SGA Global LLC.”

    Thank you lane, you are my lord!

Viewing 4 replies - 1 through 4 (of 4 total)