<?php
defined( 'ABSPATH' ) || exit;

/**
 * Compatibility with plugin: Advanced Coupons for WooCommerce Free (by Rymera Web Co).
 */
class FluidCheckout_AdvancedCouponsForWooCommerceFree extends FluidCheckout {

	/**
	 * __construct function.
	 */
	public function __construct() {
		$this->hooks();
	}



	/**
	 * Initialize hooks.
	 */
	public function hooks() {
		// Optional fields
		add_filter( 'fc_hide_optional_fields_skip_list', array( $this, 'prevent_hide_optional_fields_store_credits' ), 10 );

		// Checkout page
		add_filter( 'acfw_filter_is_current_page_using_cart_checkout_block', '__return_false', 10 );
	}


	
	/**
	 * Prevent hiding optional field for the store credits behind a link button.
	 *
	 * @param   array  $skip_list  List of optional fields to skip hidding.
	 */
	public function prevent_hide_optional_fields_store_credits( $skip_list ) {
		$skip_list[] = 'acfw_redeem_store_credit';
		return $skip_list;
	}

}

FluidCheckout_AdvancedCouponsForWooCommerceFree::instance();
