<?php

namespace Licenzo\Modules\WooCommerce;

use Licenzo\Helper\Settings;

// Prevent direct access
if (!defined('ABSPATH')) {
    exit;
}

class WooCommerce
{
    public static function bootstrap(): void
    {
        (new WooOrderHandler())->handle();
        (new WooStripeCompatibilityService())->register();
        (new WooSubscriptionCheckoutPolicyService())->register();
        (new WooPriceDisplayService())->register();
        (new WooProductAdminMappingService())->register();
    }

    public static function init(): void
    {
        $settings = Settings::getGeneralSettings();

        if (($settings['enable_woo_my_account'] ?? 'yes') === 'yes') {
            Account::register();
        }
    }
}
