<?php

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

class Wiaas_Admin_Package {

	public static function init() {

		require_once dirname( __FILE__ ) . '/package/class-wiaas-admin-linked-packages.php';
		require_once dirname( __FILE__ ) . '/package/class-wiaas-admin-package-types.php';

		add_action( 'woocommerce_product_data_tabs', array( __CLASS__, 'package_data_tabs' ), 1 );

		add_action( 'manage_product_posts_columns', array( __CLASS__, 'manage_list_table_products_columns' ), 999, 2 );
	}

	/**
	 *  Hide default WC_Product data panels.
	 *
	 * @param array $tabs
	 *
	 * @return mixed
	 */
	public static function package_data_tabs($tabs) {

		$tabs['general']['class'] = array( 'show_if_simple', 'show_if_bundle');

		unset($tabs['attribute']);
		unset($tabs['variations']);
		unset($tabs['advanced']);
		unset($tabs['shipping']);

		return $tabs;
	}

	/**
	 * Customize list table product columns
	 *
	 * @param array $columns
	 *
	 * @return array
	 */
	public static function manage_list_table_products_columns($columns) {
		$columns['product_tag'] = __( 'Reference', 'wiaas' );

		return $columns;
	}
}

Wiaas_Admin_Package::init();