<?php

namespace Cart\notify\WooCommerce;

defined( 'ABSPATH' ) || exit;

/**
 * WooCommerce feature compatibility declarations.
 */
class Compatibility {
	/**
	 * Initialize compatibility hooks.
	 */
	public function __construct() {
		add_action( 'before_woocommerce_init', array( $this, 'declare_feature_compatibility' ) );
	}

	/**
	 * Declare compatibility for WooCommerce optional features.
	 *
	 * @return void
	 */
	public function declare_feature_compatibility() {
		if ( ! class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) {
			return;
		}

		\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', CART_NOTIFY_FILE, true );
		\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', CART_NOTIFY_FILE, true );
	}
}

