<?php
/**
 * Notice handler class
 *
 * @link https://www.fooevents.com
 * @package woocommerce-events
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;}


/**
 * Notice handler class
 */
class FooEvents_Notices {

	/**
	 * Configuration object
	 *
	 * @var array $config
	 */
	public $config;

	/**
	 * If the attendee page is enabled.
	 *
	 * @var bool $is_attendee_page_enabled
	 */
	public $is_attendee_page_enabled;

	/**
	 * If the checkout block is enabled.
	 *
	 * @var bool $is_checkout_block_enabled
	 */
	public $is_checkout_block_enabled;

	/**
	 * On class load
	 *
	 * @param array $config configuration values.
	 */
	public function __construct( $config, $is_attendee_page_enabled, $is_checkout_block_enabled ) {

		$this->config                    = $config;
		$this->is_attendee_page_enabled  = $is_attendee_page_enabled;
		$this->is_checkout_block_enabled = $is_checkout_block_enabled;
		$this->display_notices();
	}

	/**
	 * Main notice method.
	 */
	public function display_notices() {

		$this->attendee_page_disabled_notice();
	}

	/**
	 * Display a notice if the WooCommerce checkout block is enabled but the attendee page is disabled.
	 */
	public function attendee_page_disabled_notice() {

		if ( is_admin() && 'yes' === $this->is_checkout_block_enabled && 'yes' !== $is_attendee_page_enabled ) {

            echo "YES";

		}
	}
}
