Skip to content

Instantly share code, notes, and snippets.

@danielbitzer
Last active September 14, 2022 11:27
Show Gist options
  • Save danielbitzer/a11ffc5b3e2fd7e1f280cb8b3977b0d7 to your computer and use it in GitHub Desktop.
Save danielbitzer/a11ffc5b3e2fd7e1f280cb8b3977b0d7 to your computer and use it in GitHub Desktop.
AutomateWoo - Set which order to use for email previews
<?php
add_filter( 'automatewoo/preview_data_layer', 'my_filter_automatewoo_preview_data_layer' );
/**
* @param array $data
* @return array
*/
function my_filter_automatewoo_preview_data_layer( $data ) {
$preview_order_id = 123;
$data['order'] = wc_get_order( $preview_order_id );
$data['customer'] = \AutomateWoo\Customer_Factory::get_by_order( $data['order'] );
return $data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment