<?php
/**
 * WooCommerce Filter Hook
 *
 * @category   WordPress_Plugin
 * @package    Common
 * @subpackage Hooks
 * @author     miniOrange <info@miniorange.com>
 * @license    MIT/Expat
 * @link       https://plugins.miniorange.com/woocommerce-api-product-sync-with-woocommerce-rest-apis
 */

namespace MOWCPS\Common\Hooks\suppliers;

use MOWCPS\Common\Interfaces\Hookable_Interface;
use MOWCPS\Common\Constants\Plugin_Filters;
use MOWCPS\Common\Suppliers\Woocommerce as WooCommerce_Suppliers;

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

/**
 * Class Woocommerce
 *
 * Handles Woocommerce filter hook registration
 */
class Woocommerce implements Hookable_Interface {

	/**
	 * Initialize the Woocommerce filter hooks.
	 */
	public function __construct() {
		$this->register_hooks();
	}

	/**
	 * Register WordPress hooks.
	 *
	 * @return void
	 */
	public function register_hooks() {
		add_filter( Plugin_Filters::FILTER_WC_CATEGORY_ALTERATION_FILTER, array( WooCommerce_Suppliers::class, 'modify_categories' ), 10, 1 );
		add_filter( Plugin_Filters::FILTER_WC_CATEGORY_ALTERATION_FILTER, array( WooCommerce_Suppliers::class, 'form_category_for_woocommerce' ), 10, 1 );
	}
}
