• Hi.

    I am trying to generate an export which pulls in an ACF custom field from product meta that was within the order, however, certain products are returning NaN yet other products (the SAME product) are returning the correct data. here is the script:

    add_filter('woe_get_order_product_value_Course_Date', function ($value, $order, $item, $product,$item_meta) {
    
    return get_field('date_start', $product->id, false, false);
    }, 10, 5);

    for products that have a date_start value this is being returned, yet on subsequent order lines, for the same product, the date is returning as NaN. for products which do not include a date_start, nothing is returned (this is correct).

    the problem appears to be the inconsistency between the same products in different orders

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author algol.plus

    (@algolplus)

    hi

    please, open this order and share screenhsot of the section “Items”

    Thread Starter volcomjon

    (@volcomjon)

    can you be more specific please. where do you mean “items”

    Plugin Author algol.plus

    (@algolplus)

    Thread Starter volcomjon

    (@volcomjon)

    here you can see the preview results of the export:

    https://snipboard.io/4iemuY.jpg

    there are 3 types of products:
    course (which returns the course date)
    a voucher (which has no start date)
    a product (which returns no start date).

    in the screenshot above, you can see order ID 19198 and 19196 both have voucher products, one is returning “field_54204715de01b” (no data), yet the other is returning NaN. both products are setup the same. again, order 19179 also says NaN

    further down, a physical product (order 19173) is also returning NaN where other physical products are returning the empty field.

    products do not show this data in order items, so no need to send screenshots of these.

    for the products in 19198 and 19196, both course_date fields are blank as dates do not apply to these products, the same is said for the physical products (19173)

    https://snipboard.io/Yh4CI6.jpg

    Thread Starter volcomjon

    (@volcomjon)

    here is the FULL custom php script :

    add_filter('woe_get_order_value_recipients_included',function ($recipient, $order,$fieldname) {
    $recipient_check = get_post_meta( $order->ID, 'List of recipients', true );
    if ( !empty($recipient_check)) {
    $recipient = "1";
    } else {
    $recipient = "0";
    };
    return $recipient;
    },10,3);
    
    <!--------- THIS IS THE PART GETTING THE COURSE DATE ----------->
    
    add_filter('woe_get_order_product_value_Course_Date', function ($prod, $order, $item, $product,$item_meta) {
    $Course_Date = get_field('date_start', $product->id, false, false);
    
    if ( !empty($Course_Date)) {
    $prod =$Course_Date;
    } else {
    $prod = "NA";
    };
    
    return $prod;
    }, 10, 5);
    
    <!--------- THIS IS THE PART GETTING THE COURSE DATE ----------->
    
    add_filter('woe_get_order_product_value_course_start_time', function ($start, $order, $item, $product,$item_meta) {
    $Course_start = get_field('hour_start', $product->id, false, false) .":".get_field('minute_start', $product->id, false, false);
    
    if ( !empty($Course_start)) {
    $start =$Course_start;
    } else {
    $start = "NA";
    };
    
    return $start;
    }, 10, 5);
    
    add_filter('woe_get_order_product_value_course_end_time', function ($end, $order, $item, $product,$item_meta) {
    $Course_end = get_field('hour_end', $product->id, false, false) .":".get_field('minute_end', $product->id, false, false);
    
    if ( !empty($Course_end)) {
    $end =$Course_end;
    } else {
    $end = "NA";
    };
    
    return $end;
    }, 10, 5);
    
    
    Plugin Author algol.plus

    (@algolplus)

    about RAW data — please, use key without prefix “_”.
    more details https://algolplus.freshdesk.com/support/solutions/articles/25000021603-i-can-t-filter-orders-by-fields-created-by-advanced-custom-fields-plugin

    If you still need help .
    Please, submit your settings and new ticket to https://algolplus.freshdesk.com/
    Use tab “Tools” to get them.

    Thread Starter volcomjon

    (@volcomjon)

    in all cases where I have referenced the key, I am using the one WITHOUT the _ including the raw data (this was only for output to see what was being pulled through)

    Plugin Author algol.plus

    (@algolplus)

    Please, share your settings + export ACF group.

    Thread Starter volcomjon

    (@volcomjon)

    ACF Field:

    https://snipboard.io/YBlidf.jpg

    what other settings do you need?

    Plugin Author algol.plus

    (@algolplus)

    I’m sorry, but I need just 2 files to fully repeat your setup.

    1. visit Main Menu>Custom Fields>Tools and export ACF group.
    2. visit Main Menu>WooCommerce>Export Orders>Tools and copy/paste settings.

    Thread Starter volcomjon

    (@volcomjon)

    Export Settings:

    
    {
        "now": {
            "version": "2.0",
            "mode": "now",
            "title": "",
            "skip_empty_file": true,
            "log_results": false,
            "from_status": [],
            "to_status": [],
            "change_order_status_to": "",
            "statuses": [
                "wc-pending",
                "wc-processing",
                "wc-on-hold",
                "wc-completed"
            ],
            "from_date": "",
            "to_date": "",
            "sub_start_from_date": "",
            "sub_start_to_date": "",
            "sub_end_from_date": "",
            "sub_end_to_date": "",
            "sub_next_paym_from_date": "",
            "sub_next_paym_to_date": "",
            "from_order_id": "",
            "to_order_id": "",
            "shipping_locations": [],
            "shipping_methods": [],
            "item_names": [],
            "item_metadata": [],
            "user_roles": [],
            "user_names": [],
            "user_custom_fields": [],
            "billing_locations": [],
            "payment_methods": [],
            "any_coupon_used": 0,
            "coupons": [],
            "order_custom_fields": [],
            "product_categories": [],
            "product_vendors": [],
            "products": [],
            "product_sku": "",
            "exclude_products": [],
            "product_taxonomies": [],
            "product_custom_fields": [],
            "product_attributes": [],
            "product_itemmeta": [],
            "format": "XLS",
            "format_xls_use_xls_format": 0,
            "format_xls_sheet_name": "Orders",
            "format_xls_display_column_names": 1,
            "format_xls_auto_width": 1,
            "format_xls_direction_rtl": 0,
            "format_xls_force_general_format": 0,
            "format_xls_remove_emojis": 0,
            "format_xls_row_images_width": 50,
            "format_xls_row_images_height": 50,
            "format_csv_enclosure": "\"",
            "format_csv_delimiter": ",",
            "format_csv_linebreak": "\\r\\n",
            "format_csv_display_column_names": 1,
            "format_csv_add_utf8_bom": 0,
            "format_csv_item_rows_start_from_new_line": 0,
            "format_csv_encoding": "UTF-8",
            "format_csv_delete_linebreaks": 0,
            "format_csv_remove_linebreaks": 0,
            "format_csv_force_quotes": 0,
            "format_tsv_linebreak": "\\r\\n",
            "format_tsv_display_column_names": 1,
            "format_tsv_add_utf8_bom": 0,
            "format_tsv_item_rows_start_from_new_line": 0,
            "format_tsv_encoding": "UTF-8",
            "format_xml_root_tag": "Orders",
            "format_xml_order_tag": "Order",
            "format_xml_product_tag": "Product",
            "format_xml_coupon_tag": "Coupon",
            "format_xml_prepend_raw_xml": "",
            "format_xml_append_raw_xml": "",
            "format_xml_self_closing_tags": 1,
            "format_xml_preview_format": 0,
            "format_json_start_tag": "[",
            "format_json_end_tag": "]",
            "format_json_unescaped_slashes": 0,
            "format_json_numeric_check": 0,
            "format_json_encode_unicode": 0,
            "format_pdf_display_column_names": 1,
            "format_pdf_repeat_header": 1,
            "format_pdf_direction_rtl": 0,
            "format_pdf_orientation": "L",
            "format_pdf_page_size": "A4",
            "format_pdf_font_size": 8,
            "format_pdf_header_text": "",
            "format_pdf_footer_text": "",
            "format_pdf_pagination": "C",
            "format_pdf_fit_page_width": 0,
            "format_pdf_cols_width": "25",
            "format_pdf_cols_align": "L",
            "format_pdf_cols_vertical_align": "T",
            "format_pdf_page_header_text_color": "#000000",
            "format_pdf_page_footer_text_color": "#000000",
            "format_pdf_table_header_text_color": "#000000",
            "format_pdf_table_header_background_color": "#FFFFFF",
            "format_pdf_table_row_text_color": "#000000",
            "format_pdf_table_row_background_color": "#FFFFFF",
            "format_pdf_logo_source_id": 0,
            "format_pdf_logo_source": "",
            "format_pdf_logo_width": 0,
            "format_pdf_logo_height": 15,
            "format_pdf_logo_align": "R",
            "format_pdf_row_images_width": 15,
            "format_pdf_row_images_height": 15,
            "format_pdf_row_images_add_link": 0,
            "format_pdf_row_dont_page_break_order_lines": 0,
            "format_html_display_column_names": 1,
            "format_html_repeat_header_last_line": 0,
            "format_html_font_size": 13,
            "format_html_header_text": "",
            "format_html_footer_text": "",
            "format_html_cols_align": "L",
            "format_html_header_text_color": "#000000",
            "format_html_footer_text_color": "#000000",
            "format_html_table_header_text_color": "#000000",
            "format_html_table_header_background_color": "#FFFFFF",
            "format_html_table_row_text_color": "#000000",
            "format_html_table_row_background_color": "#FFFFFF",
            "format_html_row_images_width": 100,
            "format_html_row_images_height": 100,
            "format_html_images_add_link": 0,
            "format_html_custom_css": "",
            "all_products_from_order": 1,
            "skip_refunded_items": 0,
            "skip_suborders": 0,
            "export_refunds": 0,
            "export_matched_items": 0,
            "date_format": "Y-m-d",
            "time_format": "H:i",
            "sort_direction": "DESC",
            "sort": "order_id",
            "format_number_fields": 0,
            "export_all_comments": 0,
            "export_refund_notes": 0,
            "strip_tags_product_fields": 0,
            "round_item_tax_rate": 0,
            "cleanup_phone": 0,
            "convert_serialized_values": 0,
            "enable_debug": 0,
            "billing_details_for_shipping": 0,
            "custom_php": 0,
            "custom_php_code": "",
            "mark_exported_orders": 0,
            "export_unmarked_orders": 0,
            "summary_report_by_products": 0,
            "duplicated_fields_settings": {
                "products": {
                    "repeat": "rows",
                    "populate_other_columns": "1",
                    "max_cols": "10",
                    "line_delimiter": "\\n",
                    "group_by": "product"
                },
                "coupons": {
                    "repeat": "rows",
                    "max_cols": "10",
                    "line_delimiter": "\\n",
                    "group_by": "product"
                }
            },
            "summary_report_by_customers": 0,
            "order_fields": [
                {
                    "label": "Order Number",
                    "format": "string",
                    "segment": "common",
                    "colname": "Order Number",
                    "default": 1,
                    "key": "order_number"
                },
                {
                    "label": "Order Status",
                    "format": "string",
                    "segment": "common",
                    "colname": "Order Status",
                    "default": 1,
                    "key": "order_status"
                },
                {
                    "label": "Order Date",
                    "format": "date",
                    "segment": "common",
                    "colname": "Order Date",
                    "default": 1,
                    "key": "order_date"
                },
                {
                    "label": "Customer Note",
                    "format": "string",
                    "segment": "common",
                    "colname": "Customer Note",
                    "default": 1,
                    "key": "customer_note"
                },
                {
                    "label": "First Name (Billing)",
                    "format": "string",
                    "segment": "billing",
                    "colname": "First Name (Billing)",
                    "default": 1,
                    "key": "billing_first_name"
                },
                {
                    "label": "Last Name (Billing)",
                    "format": "string",
                    "segment": "billing",
                    "colname": "Last Name (Billing)",
                    "default": 1,
                    "key": "billing_last_name"
                },
                {
                    "label": "Company (Billing)",
                    "format": "string",
                    "segment": "billing",
                    "colname": "Company (Billing)",
                    "default": 1,
                    "key": "billing_company"
                },
                {
                    "label": "Address 1&2 (Billing)",
                    "format": "string",
                    "segment": "billing",
                    "colname": "Address 1&2 (Billing)",
                    "default": 1,
                    "key": "billing_address"
                },
                {
                    "label": "City (Billing)",
                    "format": "string",
                    "segment": "billing",
                    "colname": "City (Billing)",
                    "default": 1,
                    "key": "billing_city"
                },
                {
                    "label": "State Code (Billing)",
                    "format": "string",
                    "segment": "billing",
                    "colname": "State Code (Billing)",
                    "default": 1,
                    "key": "billing_state"
                },
                {
                    "label": "Postcode (Billing)",
                    "format": "string",
                    "segment": "billing",
                    "colname": "Postcode (Billing)",
                    "default": 1,
                    "key": "billing_postcode"
                },
                {
                    "label": "Country Code (Billing)",
                    "format": "string",
                    "segment": "billing",
                    "colname": "Country Code (Billing)",
                    "default": 1,
                    "key": "billing_country"
                },
                {
                    "label": "Email (Billing)",
                    "format": "string",
                    "segment": "billing",
                    "colname": "Email (Billing)",
                    "default": 1,
                    "key": "billing_email"
                },
                {
                    "label": "Phone (Billing)",
                    "format": "string",
                    "segment": "billing",
                    "colname": "Phone (Billing)",
                    "default": 1,
                    "key": "billing_phone"
                },
                {
                    "label": "First Name (Shipping)",
                    "format": "string",
                    "segment": "shipping",
                    "colname": "First Name (Shipping)",
                    "default": 1,
                    "key": "shipping_first_name"
                },
                {
                    "label": "Last Name (Shipping)",
                    "format": "string",
                    "segment": "shipping",
                    "colname": "Last Name (Shipping)",
                    "default": 1,
                    "key": "shipping_last_name"
                },
                {
                    "label": "Address 1&2 (Shipping)",
                    "format": "string",
                    "segment": "shipping",
                    "colname": "Address 1&2 (Shipping)",
                    "default": 1,
                    "key": "shipping_address"
                },
                {
                    "label": "City (Shipping)",
                    "format": "string",
                    "segment": "shipping",
                    "colname": "City (Shipping)",
                    "default": 1,
                    "key": "shipping_city"
                },
                {
                    "label": "State Code (Shipping)",
                    "format": "string",
                    "segment": "shipping",
                    "colname": "State Code (Shipping)",
                    "default": 1,
                    "key": "shipping_state"
                },
                {
                    "label": "Postcode (Shipping)",
                    "format": "string",
                    "segment": "shipping",
                    "colname": "Postcode (Shipping)",
                    "default": 1,
                    "key": "shipping_postcode"
                },
                {
                    "label": "Country Code (Shipping)",
                    "format": "string",
                    "segment": "shipping",
                    "colname": "Country Code (Shipping)",
                    "default": 1,
                    "key": "shipping_country"
                },
                {
                    "label": "Products",
                    "repeat": "rows",
                    "max_cols": 10,
                    "segment": "products",
                    "colname": "Products",
                    "default": 1,
                    "key": "products"
                },
                {
                    "label": "Coupons",
                    "repeat": "rows",
                    "max_cols": 10,
                    "segment": "coupons",
                    "colname": "Coupons",
                    "default": 1,
                    "key": "coupons"
                },
                {
                    "label": "Payment Method Title",
                    "format": "string",
                    "segment": "cart",
                    "colname": "Payment Method Title",
                    "default": 1,
                    "key": "payment_method_title"
                },
                {
                    "label": "Cart Discount Amount",
                    "format": "money",
                    "segment": "cart",
                    "colname": "Cart Discount Amount",
                    "default": 1,
                    "key": "cart_discount"
                },
                {
                    "label": "Order Subtotal Amount",
                    "format": "money",
                    "segment": "cart",
                    "colname": "Order Subtotal Amount",
                    "default": 1,
                    "key": "order_subtotal"
                },
                {
                    "label": "Shipping Method Title",
                    "format": "string",
                    "segment": "ship_calc",
                    "colname": "Shipping Method Title",
                    "default": 1,
                    "key": "shipping_method_title"
                },
                {
                    "label": "Order Shipping Amount",
                    "format": "money",
                    "segment": "ship_calc",
                    "colname": "Order Shipping Amount",
                    "default": 1,
                    "key": "order_shipping"
                },
                {
                    "label": "Order Refund Amount",
                    "format": "money",
                    "segment": "totals",
                    "colname": "Order Refund Amount",
                    "default": 1,
                    "key": "order_refund"
                },
                {
                    "label": "Order Total Amount",
                    "format": "money",
                    "segment": "totals",
                    "colname": "Order Total Amount",
                    "default": 1,
                    "key": "order_total"
                },
                {
                    "label": "Order Total Tax Amount",
                    "format": "money",
                    "segment": "totals",
                    "colname": "Order Total Tax Amount",
                    "default": 1,
                    "key": "order_total_tax"
                },
                {
                    "label": "SKU",
                    "format": "string",
                    "colname": "SKU",
                    "default": 1,
                    "key": "plain_products_sku",
                    "segment": "products"
                },
                {
                    "label": "Item #",
                    "format": "number",
                    "colname": "Item #",
                    "default": 1,
                    "key": "plain_products_line_id",
                    "segment": "products"
                },
                {
                    "label": "Item Name",
                    "format": "string",
                    "colname": "Item Name",
                    "default": 1,
                    "key": "plain_products_name",
                    "segment": "products"
                },
                {
                    "label": "Quantity",
                    "format": "number",
                    "colname": "Quantity",
                    "default": 1,
                    "key": "plain_products_qty",
                    "segment": "products"
                },
                {
                    "label": "Item Cost",
                    "format": "money",
                    "colname": "Item Cost",
                    "default": 1,
                    "key": "plain_products_item_price",
                    "segment": "products"
                },
                {
                    "label": "Coupon Code",
                    "format": "string",
                    "colname": "Coupon Code",
                    "default": 1,
                    "key": "plain_coupons_code",
                    "segment": "coupons"
                },
                {
                    "label": "Discount Amount",
                    "format": "money",
                    "colname": "Discount Amount",
                    "default": 1,
                    "key": "plain_coupons_discount_amount",
                    "segment": "coupons"
                },
                {
                    "label": "Discount Amount Tax",
                    "format": "money",
                    "colname": "Discount Amount Tax",
                    "default": 1,
                    "key": "plain_coupons_discount_amount_tax",
                    "segment": "coupons"
                }
            ],
            "order_product_fields": [
                {
                    "label": "SKU",
                    "format": "string",
                    "colname": "SKU",
                    "default": 1,
                    "key": "sku"
                },
                {
                    "label": "Item #",
                    "format": "number",
                    "colname": "Item #",
                    "default": 1,
                    "key": "line_id"
                },
                {
                    "label": "Item Name",
                    "format": "string",
                    "colname": "Item Name",
                    "default": 1,
                    "key": "name"
                },
                {
                    "label": "Quantity",
                    "format": "number",
                    "colname": "Quantity",
                    "default": 1,
                    "key": "qty"
                },
                {
                    "label": "Item Cost",
                    "format": "money",
                    "colname": "Item Cost",
                    "default": 1,
                    "key": "item_price"
                }
            ],
            "order_coupon_fields": [
                {
                    "label": "Coupon Code",
                    "format": "string",
                    "colname": "Coupon Code",
                    "default": 1,
                    "key": "code"
                },
                {
                    "label": "Discount Amount",
                    "format": "money",
                    "colname": "Discount Amount",
                    "default": 1,
                    "key": "discount_amount"
                },
                {
                    "label": "Discount Amount Tax",
                    "format": "money",
                    "colname": "Discount Amount Tax",
                    "default": 1,
                    "key": "discount_amount_tax"
                }
            ]
        },
        "profiles": {
            "1": {
                "version": "2.0",
                "mode": "profiles",
                "title": "TCA Data Export 1",
                "skip_empty_file": true,
                "log_results": false,
                "from_status": [],
                "to_status": [],
                "change_order_status_to": "",
                "statuses": [
                    "wc-completed"
                ],
                "from_date": "",
                "to_date": "",
                "sub_start_from_date": "",
                "sub_start_to_date": "",
                "sub_end_from_date": "",
                "sub_end_to_date": "",
                "sub_next_paym_from_date": "",
                "sub_next_paym_to_date": "",
                "from_order_id": "",
                "to_order_id": "",
                "shipping_locations": [],
                "shipping_methods": [],
                "item_names": [],
                "item_metadata": [],
                "user_roles": [],
                "user_names": [],
                "user_custom_fields": [],
                "billing_locations": [],
                "payment_methods": [],
                "any_coupon_used": "0",
                "coupons": [],
                "order_custom_fields": [],
                "product_categories": [],
                "product_vendors": [],
                "products": [],
                "product_sku": "",
                "exclude_products": [],
                "product_taxonomies": [],
                "product_custom_fields": [],
                "product_attributes": [],
                "product_itemmeta": [],
                "format": "CSV",
                "format_xls_use_xls_format": "0",
                "format_xls_sheet_name": "Orders",
                "format_xls_display_column_names": "1",
                "format_xls_auto_width": "1",
                "format_xls_direction_rtl": "0",
                "format_xls_force_general_format": "0",
                "format_xls_remove_emojis": "0",
                "format_xls_row_images_width": "50",
                "format_xls_row_images_height": "50",
                "format_csv_enclosure": "\"",
                "format_csv_delimiter": "|",
                "format_csv_linebreak": "\\r\\n",
                "format_csv_display_column_names": "1",
                "format_csv_add_utf8_bom": "0",
                "format_csv_item_rows_start_from_new_line": "0",
                "format_csv_encoding": "UTF-8",
                "format_csv_delete_linebreaks": "0",
                "format_csv_remove_linebreaks": "0",
                "format_csv_force_quotes": "0",
                "format_tsv_linebreak": "\\r\\n",
                "format_tsv_display_column_names": "1",
                "format_tsv_add_utf8_bom": "0",
                "format_tsv_item_rows_start_from_new_line": "0",
                "format_tsv_encoding": "UTF-8",
                "format_xml_root_tag": "Orders",
                "format_xml_order_tag": "Order",
                "format_xml_product_tag": "Product",
                "format_xml_coupon_tag": "Coupon",
                "format_xml_prepend_raw_xml": "",
                "format_xml_append_raw_xml": "",
                "format_xml_self_closing_tags": "1",
                "format_xml_preview_format": "0",
                "format_json_start_tag": "[",
                "format_json_end_tag": "]",
                "format_json_unescaped_slashes": 0,
                "format_json_numeric_check": 0,
                "format_json_encode_unicode": 0,
                "format_pdf_display_column_names": "1",
                "format_pdf_repeat_header": "1",
                "format_pdf_direction_rtl": 0,
                "format_pdf_orientation": "L",
                "format_pdf_page_size": "A4",
                "format_pdf_font_size": "8",
                "format_pdf_header_text": "",
                "format_pdf_footer_text": "",
                "format_pdf_pagination": "C",
                "format_pdf_fit_page_width": "0",
                "format_pdf_cols_width": "25",
                "format_pdf_cols_align": "L",
                "format_pdf_cols_vertical_align": "T",
                "format_pdf_page_header_text_color": "#000000",
                "format_pdf_page_footer_text_color": "#000000",
                "format_pdf_table_header_text_color": "#000000",
                "format_pdf_table_header_background_color": "#FFFFFF",
                "format_pdf_table_row_text_color": "#000000",
                "format_pdf_table_row_background_color": "#FFFFFF",
                "format_pdf_logo_source_id": "0",
                "format_pdf_logo_source": "",
                "format_pdf_logo_width": "0",
                "format_pdf_logo_height": "15",
                "format_pdf_logo_align": "R",
                "format_pdf_row_images_width": "15",
                "format_pdf_row_images_height": "15",
                "format_pdf_row_images_add_link": "0",
                "format_pdf_row_dont_page_break_order_lines": "0",
                "format_html_display_column_names": "1",
                "format_html_repeat_header_last_line": "0",
                "format_html_font_size": "13",
                "format_html_header_text": "",
                "format_html_footer_text": "",
                "format_html_cols_align": "L",
                "format_html_header_text_color": "#000000",
                "format_html_footer_text_color": "#000000",
                "format_html_table_header_text_color": "#000000",
                "format_html_table_header_background_color": "#FFFFFF",
                "format_html_table_row_text_color": "#000000",
                "format_html_table_row_background_color": "#FFFFFF",
                "format_html_row_images_width": "100",
                "format_html_row_images_height": "100",
                "format_html_images_add_link": "0",
                "format_html_custom_css": "",
                "all_products_from_order": "1",
                "skip_refunded_items": "0",
                "skip_suborders": "0",
                "export_refunds": "0",
                "export_matched_items": "0",
                "date_format": "Y-m-d",
                "time_format": "H:i",
                "sort_direction": "DESC",
                "sort": "order_id",
                "format_number_fields": "0",
                "export_all_comments": "0",
                "export_refund_notes": "0",
                "strip_tags_product_fields": "0",
                "round_item_tax_rate": "0",
                "cleanup_phone": "0",
                "convert_serialized_values": "0",
                "enable_debug": "1",
                "billing_details_for_shipping": "0",
                "custom_php": "1",
                "custom_php_code": "add_filter(\u0027woe_get_order_value_recipients_included\u0027,function ($value, $order,$fieldname) {\r\n$recipient_check = get_post_meta( $order->ID, \u0027List of recipients\u0027, true );\r\nif ( !empty($recipient_check)) {\r\n$value = \"1\";\r\n} else {\r\n$value = \"0\";\r\n};\r\nreturn $value;\r\n},10,3);\r\n\r\n\r\n\r\n\r\nadd_filter(\u0027woe_get_order_product_value_Course_Date\u0027, function ($value, $order, $item, $product,$item_meta) {\r\n$Course_Date = get_field(\u0027date_start\u0027, $product->id, false, false);\r\n\r\nif ( !empty($Course_Date)) {\r\n$value =$Course_Date;\r\n} else {\r\n$value = \"NA\";\r\n};\r\n\r\nreturn $value;\r\n}, 10, 5);\r\n\r\n\r\n\r\nadd_filter(\u0027woe_get_order_product_value_course_start_time\u0027, function ($value, $order, $item, $product,$item_meta) {\r\n$Course_start = get_field(\u0027hour_start\u0027, $product->id, false, false) .\":\".get_field(\u0027minute_start\u0027, $product->id, false, false);\r\n\r\nif ( !empty($Course_start)) {\r\n$start =$Course_start;\r\n} else {\r\n$start = \"NA\";\r\n};\r\n\r\nreturn $start;\r\n}, 10, 5);\r\n\r\n\r\nadd_filter(\u0027woe_get_order_product_value_course_end_time\u0027, function ($value, $order, $item, $product,$item_meta) {\r\n$Course_end = get_field(\u0027hour_end\u0027, $product->id, false, false) .\":\".get_field(\u0027minute_end\u0027, $product->id, false, false);\r\n\r\nif ( !empty($Course_end)) {\r\n$end =$Course_end;\r\n} else {\r\n$end = \"NA\";\r\n};\r\n\r\nreturn $end;\r\n}, 10, 5);\r\n\r\n\r\n",
                "mark_exported_orders": "0",
                "export_unmarked_orders": "0",
                "summary_report_by_products": "0",
                "duplicated_fields_settings": {
                    "products": {
                        "repeat": "rows",
                        "populate_other_columns": "1",
                        "max_cols": "10",
                        "group_by": "product",
                        "line_delimiter": "\\n"
                    },
                    "coupons": {
                        "repeat": "inside_one_cell",
                        "max_cols": "10",
                        "group_by": "product",
                        "line_delimiter": ","
                    }
                },
                "summary_report_by_customers": "0",
                "order_fields": [
                    {
                        "segment": "common",
                        "key": "order_number",
                        "label": "Order Number",
                        "format": "string",
                        "colname": "Order Number"
                    },
                    {
                        "segment": "common",
                        "key": "order_date",
                        "label": "Order Date",
                        "format": "date",
                        "colname": "Order Date"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_last_name",
                        "label": "Last Name (Billing)",
                        "format": "string",
                        "colname": "Surname"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_first_name",
                        "label": "First Name (Billing)",
                        "format": "string",
                        "colname": "Forename"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_address_1",
                        "label": "Address 1 (Billing)",
                        "format": "string",
                        "colname": "Address 1"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_address_2",
                        "label": "Address 2 (Billing)",
                        "format": "string",
                        "colname": "Address 2"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_city",
                        "label": "City (Billing)",
                        "format": "string",
                        "colname": "City"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_postcode",
                        "label": "Postcode (Billing)",
                        "format": "string",
                        "colname": "Postcode"
                    },
                    {
                        "segment": "billing",
                        "key": "plain_orders__billing_phone",
                        "label": "_billing_phone",
                        "format": "string",
                        "colname": "Phone"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_email",
                        "label": "Email (Billing)",
                        "format": "string",
                        "colname": "Email"
                    },
                    {
                        "segment": "cart",
                        "key": "payment_method_title",
                        "label": "Payment Method Title",
                        "format": "string",
                        "colname": "Payment Method Title"
                    },
                    {
                        "segment": "cart",
                        "key": "cart_discount",
                        "label": "Cart Discount Amount",
                        "format": "money",
                        "colname": "Cart Discount Amount"
                    },
                    {
                        "segment": "cart",
                        "key": "order_subtotal",
                        "label": "Order Subtotal Amount",
                        "format": "money",
                        "colname": "Order Subtotal Amount"
                    },
                    {
                        "segment": "ship_calc",
                        "key": "shipping_method_title",
                        "label": "Shipping Method Title",
                        "format": "string",
                        "colname": "Shipping Method Title"
                    },
                    {
                        "segment": "ship_calc",
                        "key": "order_shipping",
                        "label": "Order Shipping Amount",
                        "format": "money",
                        "colname": "Order Shipping Amount"
                    },
                    {
                        "segment": "totals",
                        "key": "order_refund",
                        "label": "Order Refund Amount",
                        "format": "money",
                        "colname": "Order Refund Amount"
                    },
                    {
                        "segment": "totals",
                        "key": "order_total",
                        "label": "Order Total Amount",
                        "format": "money",
                        "colname": "Order Total Amount"
                    },
                    {
                        "segment": "totals",
                        "key": "order_total_tax",
                        "label": "Order Total Tax Amount",
                        "format": "money",
                        "colname": "Order Total Tax Amount"
                    },
                    {
                        "segment": "misc",
                        "key": "plain_orders_recipients_included",
                        "label": "recipients_included",
                        "format": "string",
                        "colname": "Recipients Included"
                    },
                    {
                        "segment": "products",
                        "key": "products",
                        "colname": "Products",
                        "label": "Products",
                        "format": "undefined"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_Course_Date",
                        "label": "Course_Date",
                        "format": "string",
                        "colname": "Course Date"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_course_start_time",
                        "label": "course_start_time",
                        "format": "string",
                        "colname": "Course Start Time"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_course_end_time",
                        "label": "course_end_time",
                        "format": "string",
                        "colname": "Course End Time"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_product_id",
                        "label": "Product Id",
                        "format": "number",
                        "colname": "Product Id"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_sku",
                        "label": "SKU",
                        "format": "string",
                        "colname": "SKU"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_line_id",
                        "label": "Item #",
                        "format": "number",
                        "colname": "Item #"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_name",
                        "label": "Item Name",
                        "format": "string",
                        "colname": "Item Name"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_qty",
                        "label": "Quantity",
                        "format": "number",
                        "colname": "Quantity"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_item_price",
                        "label": "Item Cost",
                        "format": "money",
                        "colname": "Item Cost"
                    },
                    {
                        "segment": "coupons",
                        "key": "coupons",
                        "colname": "Coupons",
                        "label": "Coupons",
                        "format": "undefined"
                    },
                    {
                        "segment": "coupons",
                        "key": "plain_coupons_code",
                        "label": "Coupon Code",
                        "format": "string",
                        "colname": "Coupon Code"
                    },
                    {
                        "segment": "coupons",
                        "key": "plain_coupons_discount_amount",
                        "label": "Discount Amount",
                        "format": "money",
                        "colname": "Discount Amount"
                    },
                    {
                        "segment": "coupons",
                        "key": "plain_coupons_discount_amount_tax",
                        "label": "Discount Amount Tax",
                        "format": "money",
                        "colname": "Discount Amount Tax"
                    }
                ],
                "order_product_fields": [
                    {
                        "label": "SKU",
                        "format": "string",
                        "colname": "SKU",
                        "default": 1,
                        "key": "sku"
                    },
                    {
                        "label": "Item #",
                        "format": "number",
                        "colname": "Item #",
                        "default": 1,
                        "key": "line_id"
                    },
                    {
                        "label": "Item Name",
                        "format": "string",
                        "colname": "Item Name",
                        "default": 1,
                        "key": "name"
                    },
                    {
                        "label": "Quantity",
                        "format": "number",
                        "colname": "Quantity",
                        "default": 1,
                        "key": "qty"
                    },
                    {
                        "label": "Item Cost",
                        "format": "money",
                        "colname": "Item Cost",
                        "default": 1,
                        "key": "item_price"
                    }
                ],
                "order_coupon_fields": [
                    {
                        "label": "Coupon Code",
                        "format": "string",
                        "colname": "Coupon Code",
                        "default": 1,
                        "key": "code"
                    },
                    {
                        "label": "Discount Amount",
                        "format": "money",
                        "colname": "Discount Amount",
                        "default": 1,
                        "key": "discount_amount"
                    },
                    {
                        "label": "Discount Amount Tax",
                        "format": "money",
                        "colname": "Discount Amount Tax",
                        "default": 1,
                        "key": "discount_amount_tax"
                    }
                ],
                "id": 1,
                "post_type": "shop_order",
                "export_rule_field": "date",
                "export_filename": "orders-%y-%m-%d-%h-%i-%s.csv"
            },
            "2": {
                "version": "2.0",
                "mode": "profiles",
                "title": "TCA Data Export - one off exports",
                "skip_empty_file": true,
                "log_results": false,
                "from_status": [],
                "to_status": [],
                "change_order_status_to": "",
                "statuses": [
                    "wc-completed"
                ],
                "from_date": "",
                "to_date": "",
                "sub_start_from_date": "",
                "sub_start_to_date": "",
                "sub_end_from_date": "",
                "sub_end_to_date": "",
                "sub_next_paym_from_date": "",
                "sub_next_paym_to_date": "",
                "from_order_id": "",
                "to_order_id": "",
                "shipping_locations": [],
                "shipping_methods": [],
                "item_names": [],
                "item_metadata": [],
                "user_roles": [],
                "user_names": [],
                "user_custom_fields": [],
                "billing_locations": [],
                "payment_methods": [],
                "any_coupon_used": "0",
                "coupons": [],
                "order_custom_fields": [],
                "product_categories": [],
                "product_vendors": [],
                "products": [],
                "product_sku": "",
                "exclude_products": [],
                "product_taxonomies": [],
                "product_custom_fields": [],
                "product_attributes": [],
                "product_itemmeta": [],
                "format": "CSV",
                "format_xls_use_xls_format": "0",
                "format_xls_sheet_name": "Orders",
                "format_xls_display_column_names": "1",
                "format_xls_auto_width": "1",
                "format_xls_direction_rtl": "0",
                "format_xls_force_general_format": "0",
                "format_xls_remove_emojis": "0",
                "format_xls_row_images_width": "50",
                "format_xls_row_images_height": "50",
                "format_csv_enclosure": "\"",
                "format_csv_delimiter": "|",
                "format_csv_linebreak": "\\r\\n",
                "format_csv_display_column_names": "1",
                "format_csv_add_utf8_bom": "0",
                "format_csv_item_rows_start_from_new_line": "0",
                "format_csv_encoding": "UTF-8",
                "format_csv_delete_linebreaks": "0",
                "format_csv_remove_linebreaks": "0",
                "format_csv_force_quotes": "0",
                "format_tsv_linebreak": "\\r\\n",
                "format_tsv_display_column_names": "1",
                "format_tsv_add_utf8_bom": "0",
                "format_tsv_item_rows_start_from_new_line": "0",
                "format_tsv_encoding": "UTF-8",
                "format_xml_root_tag": "Orders",
                "format_xml_order_tag": "Order",
                "format_xml_product_tag": "Product",
                "format_xml_coupon_tag": "Coupon",
                "format_xml_prepend_raw_xml": "",
                "format_xml_append_raw_xml": "",
                "format_xml_self_closing_tags": "1",
                "format_xml_preview_format": "0",
                "format_json_start_tag": "[",
                "format_json_end_tag": "]",
                "format_json_unescaped_slashes": 0,
                "format_json_numeric_check": 0,
                "format_json_encode_unicode": 0,
                "format_pdf_display_column_names": "1",
                "format_pdf_repeat_header": "1",
                "format_pdf_direction_rtl": 0,
                "format_pdf_orientation": "L",
                "format_pdf_page_size": "A4",
                "format_pdf_font_size": "8",
                "format_pdf_header_text": "",
                "format_pdf_footer_text": "",
                "format_pdf_pagination": "C",
                "format_pdf_fit_page_width": "0",
                "format_pdf_cols_width": "25",
                "format_pdf_cols_align": "L",
                "format_pdf_cols_vertical_align": "T",
                "format_pdf_page_header_text_color": "#000000",
                "format_pdf_page_footer_text_color": "#000000",
                "format_pdf_table_header_text_color": "#000000",
                "format_pdf_table_header_background_color": "#FFFFFF",
                "format_pdf_table_row_text_color": "#000000",
                "format_pdf_table_row_background_color": "#FFFFFF",
                "format_pdf_logo_source_id": "0",
                "format_pdf_logo_source": "",
                "format_pdf_logo_width": "0",
                "format_pdf_logo_height": "15",
                "format_pdf_logo_align": "R",
                "format_pdf_row_images_width": "15",
                "format_pdf_row_images_height": "15",
                "format_pdf_row_images_add_link": "0",
                "format_pdf_row_dont_page_break_order_lines": "0",
                "format_html_display_column_names": "1",
                "format_html_repeat_header_last_line": "0",
                "format_html_font_size": "13",
                "format_html_header_text": "",
                "format_html_footer_text": "",
                "format_html_cols_align": "L",
                "format_html_header_text_color": "#000000",
                "format_html_footer_text_color": "#000000",
                "format_html_table_header_text_color": "#000000",
                "format_html_table_header_background_color": "#FFFFFF",
                "format_html_table_row_text_color": "#000000",
                "format_html_table_row_background_color": "#FFFFFF",
                "format_html_row_images_width": "100",
                "format_html_row_images_height": "100",
                "format_html_images_add_link": "0",
                "format_html_custom_css": "",
                "all_products_from_order": "1",
                "skip_refunded_items": "0",
                "skip_suborders": "0",
                "export_refunds": "0",
                "export_matched_items": "0",
                "date_format": "Y-m-d",
                "time_format": "H:i",
                "sort_direction": "DESC",
                "sort": "order_id",
                "format_number_fields": "0",
                "export_all_comments": "0",
                "export_refund_notes": "0",
                "strip_tags_product_fields": "0",
                "round_item_tax_rate": "0",
                "cleanup_phone": "0",
                "convert_serialized_values": "0",
                "enable_debug": "1",
                "billing_details_for_shipping": "0",
                "custom_php": "1",
                "custom_php_code": "add_filter(\u0027woe_get_order_value_recipients_included\u0027,function ($value, $order,$fieldname) {\r\n$recipient_check = get_post_meta( $order->ID, \u0027List of recipients\u0027, true );\r\nif ( !empty($recipient_check)) {\r\n$value = \"1\";\r\n} else {\r\n$value = \"0\";\r\n};\r\nreturn $value;\r\n},10,3);\r\n\r\n\r\n\r\n\r\nadd_filter(\u0027woe_get_order_product_value_Course_Date\u0027, function ($value, $order, $item, $product,$item_meta) {\r\n$Course_Date = get_field(\u0027date_start\u0027, $product->id, false, false);\r\n\r\nif ( !empty($Course_Date)) {\r\n$value =$Course_Date;\r\n} else {\r\n$value = \"NA\";\r\n};\r\n\r\nreturn $value;\r\n}, 10, 5);\r\n\r\n\r\n\r\nadd_filter(\u0027woe_get_order_product_value_course_start_time\u0027, function ($value, $order, $item, $product,$item_meta) {\r\n$Course_start = get_field(\u0027hour_start\u0027, $product->id, false, false) .\":\".get_field(\u0027minute_start\u0027, $product->id, false, false);\r\n\r\nif ( !empty($Course_start)) {\r\n$start =$Course_start;\r\n} else {\r\n$start = \"NA\";\r\n};\r\n\r\nreturn $start;\r\n}, 10, 5);\r\n\r\n\r\nadd_filter(\u0027woe_get_order_product_value_course_end_time\u0027, function ($value, $order, $item, $product,$item_meta) {\r\n$Course_end = get_field(\u0027hour_end\u0027, $product->id, false, false) .\":\".get_field(\u0027minute_end\u0027, $product->id, false, false);\r\n\r\nif ( !empty($Course_end)) {\r\n$end =$Course_end;\r\n} else {\r\n$end = \"NA\";\r\n};\r\n\r\nreturn $end;\r\n}, 10, 5);\r\n\r\n\r\n",
                "mark_exported_orders": "0",
                "export_unmarked_orders": "0",
                "summary_report_by_products": "0",
                "duplicated_fields_settings": {
                    "products": {
                        "repeat": "rows",
                        "populate_other_columns": "1",
                        "max_cols": "10",
                        "group_by": "product",
                        "line_delimiter": "\\n"
                    },
                    "coupons": {
                        "repeat": "inside_one_cell",
                        "max_cols": "10",
                        "group_by": "product",
                        "line_delimiter": ","
                    }
                },
                "summary_report_by_customers": "0",
                "order_fields": [
                    {
                        "segment": "common",
                        "key": "order_number",
                        "label": "Order Number",
                        "format": "string",
                        "colname": "Order Number"
                    },
                    {
                        "segment": "common",
                        "key": "order_date",
                        "label": "Order Date",
                        "format": "date",
                        "colname": "Order Date"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_last_name",
                        "label": "Last Name (Billing)",
                        "format": "string",
                        "colname": "Surname"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_first_name",
                        "label": "First Name (Billing)",
                        "format": "string",
                        "colname": "Forename"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_address_1",
                        "label": "Address 1 (Billing)",
                        "format": "string",
                        "colname": "Address 1"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_address_2",
                        "label": "Address 2 (Billing)",
                        "format": "string",
                        "colname": "Address 2"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_city",
                        "label": "City (Billing)",
                        "format": "string",
                        "colname": "City"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_postcode",
                        "label": "Postcode (Billing)",
                        "format": "string",
                        "colname": "Postcode"
                    },
                    {
                        "segment": "billing",
                        "key": "plain_orders__billing_phone",
                        "label": "_billing_phone",
                        "format": "string",
                        "colname": "Phone"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_email",
                        "label": "Email (Billing)",
                        "format": "string",
                        "colname": "Email"
                    },
                    {
                        "segment": "cart",
                        "key": "payment_method_title",
                        "label": "Payment Method Title",
                        "format": "string",
                        "colname": "Payment Method Title"
                    },
                    {
                        "segment": "cart",
                        "key": "cart_discount",
                        "label": "Cart Discount Amount",
                        "format": "money",
                        "colname": "Cart Discount Amount"
                    },
                    {
                        "segment": "cart",
                        "key": "order_subtotal",
                        "label": "Order Subtotal Amount",
                        "format": "money",
                        "colname": "Order Subtotal Amount"
                    },
                    {
                        "segment": "ship_calc",
                        "key": "shipping_method_title",
                        "label": "Shipping Method Title",
                        "format": "string",
                        "colname": "Shipping Method Title"
                    },
                    {
                        "segment": "ship_calc",
                        "key": "order_shipping",
                        "label": "Order Shipping Amount",
                        "format": "money",
                        "colname": "Order Shipping Amount"
                    },
                    {
                        "segment": "totals",
                        "key": "order_refund",
                        "label": "Order Refund Amount",
                        "format": "money",
                        "colname": "Order Refund Amount"
                    },
                    {
                        "segment": "totals",
                        "key": "order_total",
                        "label": "Order Total Amount",
                        "format": "money",
                        "colname": "Order Total Amount"
                    },
                    {
                        "segment": "totals",
                        "key": "order_total_tax",
                        "label": "Order Total Tax Amount",
                        "format": "money",
                        "colname": "Order Total Tax Amount"
                    },
                    {
                        "segment": "misc",
                        "key": "plain_orders_recipients_included",
                        "label": "recipients_included",
                        "format": "string",
                        "colname": "Recipients Included"
                    },
                    {
                        "segment": "products",
                        "key": "products",
                        "colname": "Products",
                        "label": "Products",
                        "format": "undefined"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_Course_Date",
                        "label": "Course_Date",
                        "format": "string",
                        "colname": "Course Date"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_course_start_time",
                        "label": "course_start_time",
                        "format": "string",
                        "colname": "Course Start Time"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_course_end_time",
                        "label": "course_end_time",
                        "format": "string",
                        "colname": "Course End Time"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_product_id",
                        "label": "Product Id",
                        "format": "number",
                        "colname": "Product Id"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_sku",
                        "label": "SKU",
                        "format": "string",
                        "colname": "SKU"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_line_id",
                        "label": "Item #",
                        "format": "number",
                        "colname": "Item #"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_name",
                        "label": "Item Name",
                        "format": "string",
                        "colname": "Item Name"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_qty",
                        "label": "Quantity",
                        "format": "number",
                        "colname": "Quantity"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_item_price",
                        "label": "Item Cost",
                        "format": "money",
                        "colname": "Item Cost"
                    },
                    {
                        "segment": "coupons",
                        "key": "coupons",
                        "colname": "Coupons",
                        "label": "Coupons",
                        "format": "undefined"
                    },
                    {
                        "segment": "coupons",
                        "key": "plain_coupons_code",
                        "label": "Coupon Code",
                        "format": "string",
                        "colname": "Coupon Code"
                    },
                    {
                        "segment": "coupons",
                        "key": "plain_coupons_discount_amount",
                        "label": "Discount Amount",
                        "format": "money",
                        "colname": "Discount Amount"
                    },
                    {
                        "segment": "coupons",
                        "key": "plain_coupons_discount_amount_tax",
                        "label": "Discount Amount Tax",
                        "format": "money",
                        "colname": "Discount Amount Tax"
                    }
                ],
                "order_product_fields": [
                    {
                        "label": "SKU",
                        "format": "string",
                        "colname": "SKU",
                        "default": 1,
                        "key": "sku"
                    },
                    {
                        "label": "Item #",
                        "format": "number",
                        "colname": "Item #",
                        "default": 1,
                        "key": "line_id"
                    },
                    {
                        "label": "Item Name",
                        "format": "string",
                        "colname": "Item Name",
                        "default": 1,
                        "key": "name"
                    },
                    {
                        "label": "Quantity",
                        "format": "number",
                        "colname": "Quantity",
                        "default": 1,
                        "key": "qty"
                    },
                    {
                        "label": "Item Cost",
                        "format": "money",
                        "colname": "Item Cost",
                        "default": 1,
                        "key": "item_price"
                    }
                ],
                "order_coupon_fields": [
                    {
                        "label": "Coupon Code",
                        "format": "string",
                        "colname": "Coupon Code",
                        "default": 1,
                        "key": "code"
                    },
                    {
                        "label": "Discount Amount",
                        "format": "money",
                        "colname": "Discount Amount",
                        "default": 1,
                        "key": "discount_amount"
                    },
                    {
                        "label": "Discount Amount Tax",
                        "format": "money",
                        "colname": "Discount Amount Tax",
                        "default": 1,
                        "key": "discount_amount_tax"
                    }
                ],
                "id": 2,
                "post_type": "shop_order",
                "export_rule_field": "date",
                "export_filename": "orders-%y-%m-%d-%h-%i-%s.csv"
            }
        },
        "cron": {
            "1": {
                "version": "2.0",
                "mode": "cron",
                "title": "TCA Data Export",
                "skip_empty_file": "on",
                "log_results": "",
                "from_status": [],
                "to_status": [],
                "change_order_status_to": "",
                "statuses": [
                    "wc-completed"
                ],
                "from_date": "",
                "to_date": "",
                "sub_start_from_date": "",
                "sub_start_to_date": "",
                "sub_end_from_date": "",
                "sub_end_to_date": "",
                "sub_next_paym_from_date": "",
                "sub_next_paym_to_date": "",
                "from_order_id": "",
                "to_order_id": "",
                "shipping_locations": [],
                "shipping_methods": [],
                "item_names": [],
                "item_metadata": [],
                "user_roles": [],
                "user_names": [],
                "user_custom_fields": [],
                "billing_locations": [],
                "payment_methods": [],
                "any_coupon_used": "0",
                "coupons": [],
                "order_custom_fields": [],
                "product_categories": [],
                "product_vendors": [],
                "products": [],
                "product_sku": "",
                "exclude_products": [],
                "product_taxonomies": [],
                "product_custom_fields": [],
                "product_attributes": [],
                "product_itemmeta": [],
                "format": "CSV",
                "format_xls_use_xls_format": "0",
                "format_xls_sheet_name": "Orders",
                "format_xls_display_column_names": "1",
                "format_xls_auto_width": "1",
                "format_xls_direction_rtl": "0",
                "format_xls_force_general_format": "0",
                "format_xls_remove_emojis": "0",
                "format_xls_row_images_width": "50",
                "format_xls_row_images_height": "50",
                "format_csv_enclosure": "\"",
                "format_csv_delimiter": "|",
                "format_csv_linebreak": "\\r\\n",
                "format_csv_display_column_names": "1",
                "format_csv_add_utf8_bom": "0",
                "format_csv_item_rows_start_from_new_line": "0",
                "format_csv_encoding": "UTF-8",
                "format_csv_delete_linebreaks": "0",
                "format_csv_remove_linebreaks": "0",
                "format_csv_force_quotes": "0",
                "format_tsv_linebreak": "\\r\\n",
                "format_tsv_display_column_names": "1",
                "format_tsv_add_utf8_bom": "0",
                "format_tsv_item_rows_start_from_new_line": "0",
                "format_tsv_encoding": "UTF-8",
                "format_xml_root_tag": "Orders",
                "format_xml_order_tag": "Order",
                "format_xml_product_tag": "Product",
                "format_xml_coupon_tag": "Coupon",
                "format_xml_prepend_raw_xml": "",
                "format_xml_append_raw_xml": "",
                "format_xml_self_closing_tags": "1",
                "format_xml_preview_format": "0",
                "format_json_start_tag": "[",
                "format_json_end_tag": "]",
                "format_json_unescaped_slashes": 0,
                "format_json_numeric_check": 0,
                "format_json_encode_unicode": 0,
                "format_pdf_display_column_names": "1",
                "format_pdf_repeat_header": "1",
                "format_pdf_direction_rtl": 0,
                "format_pdf_orientation": "L",
                "format_pdf_page_size": "A4",
                "format_pdf_font_size": "8",
                "format_pdf_header_text": "",
                "format_pdf_footer_text": "",
                "format_pdf_pagination": "C",
                "format_pdf_fit_page_width": "0",
                "format_pdf_cols_width": "25",
                "format_pdf_cols_align": "L",
                "format_pdf_cols_vertical_align": "T",
                "format_pdf_page_header_text_color": "#000000",
                "format_pdf_page_footer_text_color": "#000000",
                "format_pdf_table_header_text_color": "#000000",
                "format_pdf_table_header_background_color": "#FFFFFF",
                "format_pdf_table_row_text_color": "#000000",
                "format_pdf_table_row_background_color": "#FFFFFF",
                "format_pdf_logo_source_id": "0",
                "format_pdf_logo_source": "",
                "format_pdf_logo_width": "0",
                "format_pdf_logo_height": "15",
                "format_pdf_logo_align": "R",
                "format_pdf_row_images_width": "15",
                "format_pdf_row_images_height": "15",
                "format_pdf_row_images_add_link": "0",
                "format_pdf_row_dont_page_break_order_lines": "0",
                "format_html_display_column_names": "1",
                "format_html_repeat_header_last_line": "0",
                "format_html_font_size": "13",
                "format_html_header_text": "",
                "format_html_footer_text": "",
                "format_html_cols_align": "L",
                "format_html_header_text_color": "#000000",
                "format_html_footer_text_color": "#000000",
                "format_html_table_header_text_color": "#000000",
                "format_html_table_header_background_color": "#FFFFFF",
                "format_html_table_row_text_color": "#000000",
                "format_html_table_row_background_color": "#FFFFFF",
                "format_html_row_images_width": "100",
                "format_html_row_images_height": "100",
                "format_html_images_add_link": "0",
                "format_html_custom_css": "",
                "all_products_from_order": "1",
                "skip_refunded_items": "0",
                "skip_suborders": "0",
                "export_refunds": "0",
                "export_matched_items": "0",
                "date_format": "Y-m-d",
                "time_format": "H:i",
                "sort_direction": "DESC",
                "sort": "order_id",
                "format_number_fields": "0",
                "export_all_comments": "0",
                "export_refund_notes": "0",
                "strip_tags_product_fields": "0",
                "round_item_tax_rate": "0",
                "cleanup_phone": "0",
                "convert_serialized_values": "0",
                "enable_debug": "1",
                "billing_details_for_shipping": "0",
                "custom_php": "1",
                "custom_php_code": "add_filter(\u0027woe_get_order_value_recipients_included\u0027,function ($value, $order,$fieldname) {\r\n$recipient_check = get_post_meta( $order->ID, \u0027List of recipients\u0027, true );\r\nif ( !empty($recipient_check)) {\r\n$value = \"1\";\r\n} else {\r\n$value = \"0\";\r\n};\r\nreturn $value;\r\n},10,3);\r\n\r\n\r\n\r\n\r\nadd_filter(\u0027woe_get_order_product_value_Course_Date\u0027, function ($value, $order, $item, $product,$item_meta) {\r\n$Course_Date = get_field(\u0027date_start\u0027, $product->id, false, false);\r\n\r\nif ( !empty($Course_Date)) {\r\n$value =$Course_Date;\r\n} else {\r\n$value = \"NA\";\r\n};\r\n\r\nreturn $value;\r\n}, 10, 5);\r\n\r\n\r\n\r\nadd_filter(\u0027woe_get_order_product_value_course_start_time\u0027, function ($value, $order, $item, $product,$item_meta) {\r\n$Course_start = get_field(\u0027hour_start\u0027, $product->id, false, false) .\":\".get_field(\u0027minute_start\u0027, $product->id, false, false);\r\n\r\nif ( !empty($Course_start)) {\r\n$start =$Course_start;\r\n} else {\r\n$start = \"NA\";\r\n};\r\n\r\nreturn $start;\r\n}, 10, 5);\r\n\r\n\r\nadd_filter(\u0027woe_get_order_product_value_course_end_time\u0027, function ($value, $order, $item, $product,$item_meta) {\r\n$Course_end = get_field(\u0027hour_end\u0027, $product->id, false, false) .\":\".get_field(\u0027minute_end\u0027, $product->id, false, false);\r\n\r\nif ( !empty($Course_end)) {\r\n$end =$Course_end;\r\n} else {\r\n$end = \"NA\";\r\n};\r\n\r\nreturn $end;\r\n}, 10, 5);\r\n\r\n\r\n",
                "mark_exported_orders": "0",
                "export_unmarked_orders": "0",
                "summary_report_by_products": "0",
                "duplicated_fields_settings": {
                    "products": {
                        "repeat": "rows",
                        "populate_other_columns": "1",
                        "max_cols": "10",
                        "group_by": "product",
                        "line_delimiter": "\\n"
                    },
                    "coupons": {
                        "repeat": "inside_one_cell",
                        "max_cols": "10",
                        "group_by": "product",
                        "line_delimiter": ","
                    }
                },
                "summary_report_by_customers": "0",
                "order_fields": [
                    {
                        "segment": "common",
                        "key": "order_number",
                        "label": "Order Number",
                        "format": "string",
                        "colname": "Order Number"
                    },
                    {
                        "segment": "common",
                        "key": "order_date",
                        "label": "Order Date",
                        "format": "date",
                        "colname": "Order Date"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_last_name",
                        "label": "Last Name (Billing)",
                        "format": "string",
                        "colname": "Surname"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_first_name",
                        "label": "First Name (Billing)",
                        "format": "string",
                        "colname": "Forename"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_address_1",
                        "label": "Address 1 (Billing)",
                        "format": "string",
                        "colname": "Address 1"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_address_2",
                        "label": "Address 2 (Billing)",
                        "format": "string",
                        "colname": "Address 2"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_city",
                        "label": "City (Billing)",
                        "format": "string",
                        "colname": "City"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_postcode",
                        "label": "Postcode (Billing)",
                        "format": "string",
                        "colname": "Postcode"
                    },
                    {
                        "segment": "billing",
                        "key": "plain_orders__billing_phone",
                        "label": "_billing_phone",
                        "format": "string",
                        "colname": "Phone"
                    },
                    {
                        "segment": "billing",
                        "key": "billing_email",
                        "label": "Email (Billing)",
                        "format": "string",
                        "colname": "Email"
                    },
                    {
                        "segment": "cart",
                        "key": "payment_method_title",
                        "label": "Payment Method Title",
                        "format": "string",
                        "colname": "Payment Method Title"
                    },
                    {
                        "segment": "cart",
                        "key": "cart_discount",
                        "label": "Cart Discount Amount",
                        "format": "money",
                        "colname": "Cart Discount Amount"
                    },
                    {
                        "segment": "cart",
                        "key": "order_subtotal",
                        "label": "Order Subtotal Amount",
                        "format": "money",
                        "colname": "Order Subtotal Amount"
                    },
                    {
                        "segment": "ship_calc",
                        "key": "shipping_method_title",
                        "label": "Shipping Method Title",
                        "format": "string",
                        "colname": "Shipping Method Title"
                    },
                    {
                        "segment": "ship_calc",
                        "key": "order_shipping",
                        "label": "Order Shipping Amount",
                        "format": "money",
                        "colname": "Order Shipping Amount"
                    },
                    {
                        "segment": "totals",
                        "key": "order_refund",
                        "label": "Order Refund Amount",
                        "format": "money",
                        "colname": "Order Refund Amount"
                    },
                    {
                        "segment": "totals",
                        "key": "order_total",
                        "label": "Order Total Amount",
                        "format": "money",
                        "colname": "Order Total Amount"
                    },
                    {
                        "segment": "totals",
                        "key": "order_total_tax",
                        "label": "Order Total Tax Amount",
                        "format": "money",
                        "colname": "Order Total Tax Amount"
                    },
                    {
                        "segment": "misc",
                        "key": "plain_orders_recipients_included",
                        "label": "recipients_included",
                        "format": "string",
                        "colname": "Recipients Included"
                    },
                    {
                        "segment": "products",
                        "key": "products",
                        "colname": "Products",
                        "label": "Products",
                        "format": "undefined"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_Course_Date",
                        "label": "Course_Date",
                        "format": "string",
                        "colname": "Course Date"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_course_start_time",
                        "label": "course_start_time",
                        "format": "string",
                        "colname": "Course Start Time"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_course_end_time",
                        "label": "course_end_time",
                        "format": "string",
                        "colname": "Course End Time"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_product_id",
                        "label": "Product Id",
                        "format": "number",
                        "colname": "Product Id"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_sku",
                        "label": "SKU",
                        "format": "string",
                        "colname": "SKU"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_line_id",
                        "label": "Item #",
                        "format": "number",
                        "colname": "Item #"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_name",
                        "label": "Item Name",
                        "format": "string",
                        "colname": "Item Name"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_qty",
                        "label": "Quantity",
                        "format": "number",
                        "colname": "Quantity"
                    },
                    {
                        "segment": "products",
                        "key": "plain_products_item_price",
                        "label": "Item Cost",
                        "format": "money",
                        "colname": "Item Cost"
                    },
                    {
                        "segment": "coupons",
                        "key": "coupons",
                        "colname": "Coupons",
                        "label": "Coupons",
                        "format": "undefined"
                    },
                    {
                        "segment": "coupons",
                        "key": "plain_coupons_code",
                        "label": "Coupon Code",
                        "format": "string",
                        "colname": "Coupon Code"
                    },
                    {
                        "segment": "coupons",
                        "key": "plain_coupons_discount_amount",
                        "label": "Discount Amount",
                        "format": "money",
                        "colname": "Discount Amount"
                    },
                    {
                        "segment": "coupons",
                        "key": "plain_coupons_discount_amount_tax",
                        "label": "Discount Amount Tax",
                        "format": "money",
                        "colname": "Discount Amount Tax"
                    }
                ],
                "order_product_fields": [
                    {
                        "label": "SKU",
                        "format": "string",
                        "colname": "SKU",
                        "default": 1,
                        "key": "sku"
                    },
                    {
                        "label": "Item #",
                        "format": "number",
                        "colname": "Item #",
                        "default": 1,
                        "key": "line_id"
                    },
                    {
                        "label": "Item Name",
                        "format": "string",
                        "colname": "Item Name",
                        "default": 1,
                        "key": "name"
                    },
                    {
                        "label": "Quantity",
                        "format": "number",
                        "colname": "Quantity",
                        "default": 1,
                        "key": "qty"
                    },
                    {
                        "label": "Item Cost",
                        "format": "money",
                        "colname": "Item Cost",
                        "default": 1,
                        "key": "item_price"
                    }
                ],
                "order_coupon_fields": [
                    {
                        "label": "Coupon Code",
                        "format": "string",
                        "colname": "Coupon Code",
                        "default": 1,
                        "key": "code"
                    },
                    {
                        "label": "Discount Amount",
                        "format": "money",
                        "colname": "Discount Amount",
                        "default": 1,
                        "key": "discount_amount"
                    },
                    {
                        "label": "Discount Amount Tax",
                        "format": "money",
                        "colname": "Discount Amount Tax",
                        "default": 1,
                        "key": "discount_amount_tax"
                    }
                ],
                "id": 1,
                "post_type": "shop_order",
                "export_rule_field": "date",
                "export_filename": "orders-%y-%m-%d-%h-%i-%s.csv",
                "destination": {
                    "type": [
                        "email"
                    ],
                    "email_from": "",
                    "email_from_name": "",
                    "email_subject": "TCA Order Export",
                    "email_body": "",
                    "email_recipients": "[email protected],[email protected]",
                    "email_recipients_cc": "",
                    "email_recipients_bcc": "",
                    "ftp_server": "",
                    "ftp_port": "",
                    "ftp_user": "",
                    "ftp_pass": "",
                    "ftp_path": "",
                    "ftp_conn_timeout": "",
                    "ftp_max_retries": "",
                    "sftp_server": "",
                    "sftp_port": "",
                    "sftp_user": "",
                    "sftp_pass": "",
                    "sftp_private_key_path": "",
                    "sftp_path": "",
                    "sftp_conn_timeout": "",
                    "sftp_max_retries": "",
                    "http_post_url": "",
                    "http_post_conn_timeout": "",
                    "http_post_max_retries": "",
                    "path": "\/home\/coac\/web\/thecookingacademy.co.uk\/public_html\/",
                    "zapier_export_order_product_columns": "10",
                    "zapier_export_order_coupon_columns": "10"
                },
                "export_rule": "this_year",
                "schedule": {
                    "type": "schedule-3",
                    "times": "Sun 09:00,Sun 14:00,Mon 09:00,Mon 14:00,Tue 09:00,Tue 14:00,Wed 09:00,Wed 14:00,Thu 09:00,Thu 14:00,Fri 09:00,Fri 14:00,Sat 09:00,Sat 14:00",
                    "date_times": "",
                    "last_run": 1652955323,
                    "last_report_sent": 1652955323,
                    "next_run": 1652968800
                },
                "export_rule_custom": "3"
            }
        },
        "order-action": []
    }
    
    • This reply was modified 2 years, 4 months ago by Yui. Reason: formatting
    Thread Starter volcomjon

    (@volcomjon)

    Plugin Author algol.plus

    (@algolplus)

    Thank you very much .

    Do you have problem with variable products?

    $product is varation inside hook!
    so you should use $item->get_product_id() instead of $product->id

    Thread Starter volcomjon

    (@volcomjon)

    this is still returning NaN:

    add_filter('woe_get_order_product_value_Course_Date', function ($value, $order, $item, $product,$item_meta) {
    $Course_Date = get_field('date_start', $item->get_product_id(), false, false);
    
    if ( !empty($Course_Date)) {
    $value =$Course_Date;
    } else {
    $value = "NA";
    };
    
    return $value;
    }, 10, 5);
    Plugin Author algol.plus

    (@algolplus)

    please, run phpMyAdmin, open table wp_postmeta and check if you see correct values in database for these products.
    I refer to https://snipboard.io/jabhd5.jpg

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘ACF Custom field returning NaN on some records’ is closed to new replies.