Last active
September 14, 2022 11:27
-
-
Save danielbitzer/a11ffc5b3e2fd7e1f280cb8b3977b0d7 to your computer and use it in GitHub Desktop.
AutomateWoo - Set which order to use for email previews
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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