<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * Frontpage Main woocommerce.
 *
 * @package leatherhouse
 */

defined( 'ABSPATH' ) || exit;

if ( ! class_exists( 'leatherhouse_Customize_Homepage_Woocommerce_Option' ) ) :

	class leatherhouse_Customize_Homepage_Woocommerce_Option extends leatherhouse_Customize_Base_Option {

		/**
		 * Arguments for options.
		 *
		 * @return array
		 */
		public function elements() {

			return array(

				'leatherhouse_woocommerce_heading'          => array(
					'setting' => array(),
					'control' => array(
						'type'     => 'parent_heading',
						'priority' => 1,
						'label'    => esc_html__( 'Products Options', 'leather-house' ),
						'section'  => 'leatherhouse_theme_woocommerce',
					),
				),

				// Woocommerce Enable.
				'leatherhouse_woocommerce_disabled'         => array(
					'setting' => array(
						'default'           => true,
						'sanitize_callback' => array( 'leatherhouse_Customizer_Sanitize', 'sanitize_checkbox' ),
					),
					'control' => array(
						'type'     => 'toggle',
						'priority' => 2,
						'label'    => esc_html__( 'Section Enable/Disable', 'leather-house' ),
						'section'  => 'leatherhouse_theme_woocommerce',
					),
				),

				// woocommerce Extra.
				'leatherhouse_woocommerce_extra_heading'     => array(
					'setting' => array(),
					'control' => array(
						'type'            => 'heading',
						'priority'        => 80,
						'label'           => esc_html__( 'Extra Settings', 'leather-house' ),
						'section'         => 'leatherhouse_theme_woocommerce',
						'active_callback'  => 'leatherhouse_woocommerce_extra_heading',
					),
				),

				// container.
				'leatherhouse_woocommerce_container_size'   => array(
					'setting' => array(
						'default'           => 'container-full',
						'sanitize_callback' => array( 'leatherhouse_Customizer_Sanitize', 'sanitize_radio' ),
					),
					'control' => array(
						'type'            => 'radio',
						'priority'        => 120,
						'is_default_type' => true,
						'label'           => esc_html__( 'Container Width', 'leather-house' ),
						'section'         => 'leatherhouse_theme_woocommerce',
						'choices'         => array(
							'av-container'   => esc_html__( 'Container', 'leather-house' ),
							'container-full' => esc_html__( 'Container Full', 'leather-house' ),
						),
						'active_callback'  => 'leatherhouse_woocommerce_container_size',
					),
				),
				// column layout.
				'leatherhouse_woocommerce_column_layout'    => array(
					'setting' => array(
						'default'           => 4,
						'sanitize_callback' => array( 'leatherhouse_Customizer_Sanitize', 'sanitize_radio' ),
					),
					'control' => array(
						'type'            => 'radio_image',
						'priority'        => 150,
						'label'           => esc_html__( 'Column Layout', 'leather-house' ),
						'section'         => 'leatherhouse_theme_woocommerce',
						'choices'         => array(
							'2' => get_template_directory_uri() . '/assets/images/icons/column-2.png',
							'3' => get_template_directory_uri() . '/assets/images/icons/column-3.png',
							'4' => get_template_directory_uri() . '/assets/images/icons/column-4.png',
						),
						'active_callback'  => 'leatherhouse_woocommerce_column_layout',
					),
				),
			);
		}
	}

	new leatherhouse_Customize_Homepage_Woocommerce_Option();

endif;
