register( new WC_Blocks_Tabby_Installments ); } ); } if ( interface_exists( 'Automattic\WooCommerce\Blocks\Integrations\IntegrationInterface' ) && (get_option('tabby_promo_cart') !== 'no')) { add_action( 'woocommerce_blocks_cart_block_registration', function( $integration_registry ) { $integration_registry->register( new WC_Blocks_Tabby_Cart_Promotion() ); } ); } } public static function add_checkout_methods( $methods ) { if (get_option('tabby_checkout_mode', 'payment') == 'payment') { $methods[] = 'WC_Gateway_Tabby_Installments'; if ( !isset( $_REQUEST['page'] ) || 'wc-settings' !== $_REQUEST['page'] ) { $methods[] = 'WC_Gateway_Tabby_PayLater'; $methods[] = 'WC_Gateway_Tabby_Credit_Card_Installments'; } } return $methods; } public static function on_activation() { wp_schedule_single_event( time() + 60 , 'woocommerce_tabby_cancel_unpaid_orders' ); WC_Tabby_Webhook::register(); if (WC_Tabby_Config::getShareFeed()) { WC_Tabby_Feed_Sharing::register(); } } public static function on_deactivation() { wp_clear_scheduled_hook( 'woocommerce_tabby_cancel_unpaid_orders' ); WC_Tabby_Webhook::unregister(); if (WC_Tabby_Config::getShareFeed()) { WC_Tabby_Feed_Sharing::unregister(); } } public static function init_textdomain() { load_plugin_textdomain( 'tabby-checkout', false, plugin_basename( dirname(__DIR__) ) . '/i18n/languages' ); } }