Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author PieterC

    (@siteoptimo)

    Hi Caroline,

    It probably can be done with that plugin, or with a general (free) user csv exporter plugin if the source location is saved with the customer data.

    More metrics or an aggregate overview is something we’d like to add in a next release. So right now, the best answer is to use a plugin as a workaround, but we’re working on it.

    Regards,

    Pieter

    Thread Starter CarolineElisa

    (@carolineelisa)

    Thanks Pieter. I will have a go.

    Plugin Author PieterC

    (@siteoptimo)

    Hi Caroline,

    Please report back here, in case someone else has the same question.

    Regards,

    Pieter

    Thread Starter CarolineElisa

    (@carolineelisa)

    Of course!

    I installed WooCommerce Simply Order Export and used the following code (adapted from this support post) to add ‘Source’ to the exported spreadsheet:

    //Extra fields on CSV export
    function wpg_add_columns($cols) {
    	$cols['source'] = __('Source', 'themedomain');
    	return $cols;
    }
    add_filter('wpg_order_columns', 'wpg_add_columns');
    
    function wpg_add_fields($settings) {
        $settings['source'] = array(
    								'name' => __( 'Source', 'themedomain' ),
    								'type' => 'checkbox',
    								'desc' => __( 'Source', 'themedomain' ),
    								'id'   => 'source'
    							);
    	return $settings;
    }
    add_filter('wc_settings_tab_order_export', 'wpg_add_fields');
    
    function csv_write( &$csv, $od, $field ) {
    	switch( $field ) {
    		case 'source':
    				$customfield = get_post_meta( $od->id, 'source', true );
    			array_push( $csv, $customfield );
    		break;
    		default :
    			break;
    	}
    }
    add_action('wpg_add_values_to_csv', 'csv_write', 10, 3);
    Plugin Author PieterC

    (@siteoptimo)

    Hi CarolineElisa,

    Thanks for the follow up!

    Regards,

    Pieter

    Hi Pieter and Caroline

    If either of you could help me that would be great! I took Caroline’s advice from above and added the plugin Woocommerce simple export but not sure what to do from here. Am I suppose to copy that additional code above and if so where do I place it. I really need to know where the majority of my business is coming but really don’t want to mess up my website by doing something wrong, Thanks again in advance.

    Plugin Author PieterC

    (@siteoptimo)

    Hi,

    You could add the code of Caroline to your functions.php file in your template folder or use a custom plugin for it.

    Have you noticed that with our latest update we added an extra column with the source visible from the overview? Maybe that might help too.

    Regards,

    Pieter

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

The topic ‘Reports / export spreadsheet?’ is closed to new replies.