Created
October 5, 2021 12:37
-
-
Save Pebblo/90a6db6f500bd5af3240ba108fb61144 to your computer and use it in GitHub Desktop.
Example of how you can filter registrations based on promotions.
This file contains 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 // Do not include the opening PHP tag if you already have one. | |
add_filter( | |
'FHEE__Registrations_Admin_Page___get_where_conditions_for_registrations_query', | |
'tw_ee_filter_registrations_based_on_promo', | |
10, | |
2 | |
); | |
function tw_ee_filter_registrations_based_on_promo( $where, $request_params ) | |
{ | |
//Check we have a Promotion ID set on the request. | |
if( !empty( $request_params['PRO_ID'] ) ) { | |
//Add where conditions to limit registrations based on the Promotion ID passed. | |
$where['Transaction.Line_Item.OBJ_type'] = 'Promotion'; | |
$where['Transaction.Line_Item.OBJ_ID'] = (int) $request_params['PRO_ID']; | |
} | |
return $where; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment