1. Home
  2. Docs
  3. WooCommerce Google Sheet ...
  4. Filters, Hooks & Snippets

Filters, Hooks & Snippets

  • For Adding External field in Order Header 

1 $new_headers array(
2
3     'custom_external_fields'=>'ExtraFieldWoo',
4     'custom_external_fields1'=>'Custom External Fields1',
5     'custom_external_fields2'=>'Custom External Fields2',
6     'custom_external_fields3'=>'Custom External Fields3',
7     'custom_external_fields4'=>'Custom External Fields4'
8 );
9 apply_filters( "get_external_headers",  $new_headers);

Filters Hooks Snippets WooCommerce Google Sheet Connector Pro Filters, Hooks & Snippets

  • For Adding External fields related product Header

1 $new_headers array(
2
3     'custom_external_fields'=>'ExtraFieldWoo',
4     'custom_external_fields1'=>'Custom External Fields1',
5     'custom_external_fields2'=>'Custom External Fields2',
6     'custom_external_fields3'=>'Custom External Fields3',
7     'custom_external_fields4'=>'Custom External Fields4'
8 );
9
10 apply_filters( "get_ext_product_order_headers",  $new_headers);
  • Adding new custom orders use the below hook

1 // Define the callback function
2 function add_status_and_sheets( $status_and_sheets ) {
3
4 // Modify the $status_and_sheets array
5 $status_and_sheets['query'] = 'Query';
6 // Adding a new key-value pair
7
8 // Return the modified array
9 return $status_and_sheets;
10 }
11
12 // Hook the callback function into the filter
13 add_filter( 'gscwoo_status_and_sheets''add_status_and_sheets' );

Create custom hooks for below plugins

  1. Custom Order Numbers for WooCommerce

(https://wordpress.org/plugins/custom-order-numbers-for-woocommerce/)

1 $extra_headers array(
2     '_alg_wc_full_custom_order_number' => 'Custum Order Number'
3 );
4 apply_filters( "get_external_headers",  $extra_headers);

How can we help?