Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
Created April 19, 2024 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrasguseo/1119da6d1e00d19eb14a6e0cbbb583f4 to your computer and use it in GitHub Desktop.
Save andrasguseo/1119da6d1e00d19eb14a6e0cbbb583f4 to your computer and use it in GitHub Desktop.
ET+ > Set default commerce provider
<?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