Created
April 19, 2024 19:52
-
-
Save andrasguseo/1119da6d1e00d19eb14a6e0cbbb583f4 to your computer and use it in GitHub Desktop.
ET+ > Set default commerce provider
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 | |
/** | |
* Set the default commerce provider for events | |
* | |
* Usage: Add the snippet to your functions.php file or with a plugin like Code Snippets | |
* | |
* @author: Andras Guseo | |
* | |
* Plugins required: Event Tickets Plus | |
* Created: April 10, 2024 | |
*/ | |
add_filter( 'tribe_tickets_get_default_module', 'et_default_ecommerce_module', 10, 2 ); | |
function et_default_ecommerce_module( $default, $modules ) { | |
// TC - TEC\Tickets\Commerce\Module | |
// Woo - Tribe__Tickets_Plus__Commerce__WooCommerce__Main | |
$my_default = 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main'; | |
return in_array( $my_default, $modules ) ? $my_default : $default; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment