• Resolved demuri

    (@demuri)


    Hello,
    I tried to add a code my theme functions to expose custom taxonomies (made with CPT UI) in CSV import / export. Based on your code at https://github.com/woocommerce/woocommerce/wiki/Product-CSV-Importer-&-Exporter#adding-custom-export-columns-developers I made this:

    
    function add_export_column( $columns ) {
    
    	if (is_admin()) {
    
    		// column slug => column name
    		$columns['book_author'] = 'Author(s)';
    		$columns['publisher'] = 'Publisher';
    		$columns['series'] = 'Book series';
    
    		return $columns;
    	}
    }
    add_filter( 'woocommerce_product_export_column_names', 'add_export_column' );
    add_filter( 'woocommerce_product_export_product_default_columns', 'add_export_column' );
    
    function add_export_data_book_author( $value, $product ) {
    	if (is_admin()) {
    		$value = $product->get_the_terms( 'book_author' );
    		return $value;
    	}
    }
    add_filter( 'woocommerce_product_export_product_column_book_author', 'add_export_data_book_author', 10, 2 );
    
    function add_export_data_publisher( $value, $product ) {
    	if (is_admin()) {
    		$value = $product->get_the_terms( 'publisher' );
    		return $value;
    	}
    }
    add_filter( 'woocommerce_product_export_product_column_publisher', 'add_export_data_publisher', 10, 2 );
    
    function add_export_data_series( $value, $product ) {
    	if (is_admin()) {
    		$value = $product->get_the_terms( 'series' );
    		return $value;
    	}
    }
    add_filter( 'woocommerce_product_export_product_column_series', 'add_export_data_series', 10, 2 );
    

    Now my taxonomies are exposed in export configuration, but if I include them into export config I got only endless spinner after pressing Generate button. Can’t find my mistake, hope you’ll help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    Now my taxonomies are exposed in export configuration, but if I include them into export config I got only endless spinner after pressing Generate button. Can’t find my mistake, hope you’ll help.

    That sounds like you have a Javascript problem. Can you check your browser console for any errors after pressing the Generate button:

    https://a.cl.ly/wbu0NOGr

    Kind regards,

    Plugin Support EtienneP a11n

    (@etiennep)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Expose custom taxonomies in CSV impot / export’ is closed to new replies.