Last active
September 14, 2022 11:23
-
-
Save danielbitzer/3506ad4f32777c4228d9ef24ccb4627c to your computer and use it in GitHub Desktop.
AutomateWoo - Using shop.products custom filter option
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 | |
/** | |
* Use variable {{ shop.products | type: 'custom', filter: 'my_shop_products_custom_filter' }} | |
*/ | |
add_filter( 'my_shop_products_custom_filter', 'my_shop_products_custom_filter', 10, 2 ); | |
/** | |
* @param $product_ids array | |
* @param $workflow AutomateWoo\Workflow | |
* @return array | |
*/ | |
function my_shop_products_custom_filter( $product_ids, $workflow ) { | |
// add product queries here | |
return [ 586, 4033, 582 ]; // return ids of products | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment