Exporting custom meta

function woo_ce_extend_product_item( $product, $product_id ) { $product->my_custom_field = get_post_meta( $product_id, ‘_my_custom_field’, true ); return $product; } add_filter( ‘woo_ce_product_item’, ‘custom_woo_ce_extend_product_item’, 10, 2 );Continue reading

Editing Scheduled Export e-mail content

function custom_woo_ce_email_contents( $content = ” ) { // Change the below text so whatever you prefer $content = ‘Please find attached your export ready to review.’; // wpautop() changes double line-breaks in the text into HTML paragraphs $content = wpautop(…Continue reading

Adding static Order fields to the Orders export type

function custom_woo_ce_order_fields( $fields ) { $fields[] = array( ‘name’ => ‘static_field’, ‘label’ => __( ‘Static Field’, ‘woo_ce’ ), ‘hover’ => __( ‘Static Field within functions.php’, ‘woo_ce’ ) ); return $fields; } add_filter( ‘woo_ce_order_fields’, ‘custom_woo_ce_order_fields’ ); function custom_woo_ce_order( $order, $order_id )…Continue reading

Trigger a Scheduled Export via a WordPress Action

function custom_trigger_scheduled_export_url() { $secret_key = ( isset( $_GET[‘secret_key’] ) ? sanitize_text_field( $_GET[‘secret_key’] ) : false ); if( empty( $secret_key ) ) { return; } if( $secret_key == ‘SECRET_KEY_PASSED_VIA_CRON’ ) { // This is the Post ID of the Scheduled Export…Continue reading

Adding static Product fields to the Products export type

function custom_woo_ce_extend_product_fields( $fields ) { $fields[] = array( ‘name’ => ‘static_field’, ‘label’ => __( ‘Static Field’, ‘woo_ce’ ), ‘hover’ => __( ‘Static Field within functions.php’, ‘woo_ce’ ) ); return $fields; } add_filter( ‘woo_ce_product_fields’, ‘custom_woo_ce_extend_product_fields’ ); function custom_woo_ce_extend_product_item( $product, $product_id )…Continue reading

Adding static Order Item fields to the Orders export type: unique

function custom_woo_ce_extend_order_items_unique_columns( $fields = array(), $i = 0, $original_columns = array() ) { if( isset( $original_columns[sprintf( ‘order_item_%d_static’, $i )] ) ) $fields[] = sprintf( __( ‘Order Item #%d: Static Field’, ‘woo_ce’ ), $i ); return $fields; } add_filter( ‘woo_ce_unique_order_item_columns’, ‘custom_woo_ce_extend_order_items_unique_columns’,…Continue reading