<?php
/**
* Header Banner Options.
*
* @package Omega Digital Store
*/

$omega_digital_store_default = omega_digital_store_get_default_theme_options();
$omega_digital_store_post_category_list = omega_digital_store_post_category_list();

$wp_customize->add_section( 'header_banner_setting',
    array(
    'title'      => esc_html__( 'Slider Settings', 'omega-digital-store' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'omega_digital_store_theme_home_pannel',
    )
);



// Show/Hide Site Logo
$wp_customize->add_setting('omega_digital_store_display_logo', array(
    'default'           => false,
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'omega_digital_store_sanitize_checkbox',
));
$wp_customize->add_control('omega_digital_store_display_logo', array(
    'label'    => esc_html__('Enable / Disable Site Logo', 'omega-digital-store'),
    'section'  => 'title_tagline',
    'type'     => 'checkbox',
));

// Show/Hide Site Title
$wp_customize->add_setting('omega_digital_store_display_title', array(
    'default'           => true,
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'omega_digital_store_sanitize_checkbox',
));
$wp_customize->add_control('omega_digital_store_display_title', array(
    'label'    => esc_html__('Enable / Disable Site Title', 'omega-digital-store'),
    'section'  => 'title_tagline',
    'type'     => 'checkbox',
));

// Show/Hide Site Tagline
$wp_customize->add_setting('omega_digital_store_display_header_text',
    array(
        'default'           => false,
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'omega_digital_store_sanitize_checkbox',
    )
);
$wp_customize->add_control('omega_digital_store_display_header_text',
    array(
        'label' => esc_html__('Enable / Disable Site Tagline', 'omega-digital-store'),
        'section' => 'title_tagline',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('omega_digital_store_header_banner',
    array(
        'default' => $omega_digital_store_default['omega_digital_store_header_banner'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'omega_digital_store_sanitize_checkbox',
    )
);
$wp_customize->add_control('omega_digital_store_header_banner',
    array(
        'label' => esc_html__('Enable Slider', 'omega-digital-store'),
        'section' => 'header_banner_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting( 'omega_digital_store_header_banner_cat',
    array(
    'default'           => '',
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'omega_digital_store_sanitize_select',
    )
);
$wp_customize->add_control( 'omega_digital_store_header_banner_cat',
    array(
    'label'       => esc_html__( 'Slider Post Category', 'omega-digital-store' ),
    'section'     => 'header_banner_setting',
    'type'        => 'select',
    'choices'     => $omega_digital_store_post_category_list,
    )
);

// Slider Aditional Tile
$wp_customize->add_setting( 'omega_digital_store_homepage_section_slider_aditional_title',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_homepage_section_slider_aditional_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_homepage_section_slider_aditional_title',
    array(
    'label'    => esc_html__( 'Slider Aditional Tile', 'omega-digital-store' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

// Slider Right Box 1

$wp_customize->add_setting('omega_digital_store_slider_image_box_1',array(
    'default'           => $omega_digital_store_default['omega_digital_store_slider_image_box_1'],
    'sanitize_callback' => 'esc_url_raw',
));
$wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'omega_digital_store_slider_image_box_1',array(
    'label' => __('Slider Right Image 1','omega-digital-store'),
    'section' => 'header_banner_setting'
)));

$wp_customize->add_setting( 'omega_digital_store_homepage_section_slider_right_box_1_heading',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_homepage_section_slider_right_box_1_heading'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_homepage_section_slider_right_box_1_heading',
    array(
    'label'    => esc_html__( 'Slider Right Heading 1', 'omega-digital-store' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'omega_digital_store_homepage_section_slider_right_box_1_button',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_homepage_section_slider_right_box_1_button'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_homepage_section_slider_right_box_1_button',
    array(
    'label'    => esc_html__( 'Slider Right Button Title 1', 'omega-digital-store' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'omega_digital_store_homepage_section_slider_right_box_1_button_url',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_homepage_section_slider_right_box_1_button_url'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_homepage_section_slider_right_box_1_button_url',
    array(
    'label'    => esc_html__( 'Slider Right Button Url 1', 'omega-digital-store' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

// Slider Right Box 2

$wp_customize->add_setting('omega_digital_store_slider_image_box_2',array(
    'default'           => $omega_digital_store_default['omega_digital_store_slider_image_box_2'],
    'sanitize_callback' => 'esc_url_raw',
));
$wp_customize->add_control( new WP_Customize_Image_Control($wp_customize,'omega_digital_store_slider_image_box_2',array(
    'label' => __('Slider Right Image 2','omega-digital-store'),
    'section' => 'header_banner_setting'
)));

$wp_customize->add_setting( 'omega_digital_store_homepage_section_slider_right_box_2_heading',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_homepage_section_slider_right_box_2_heading'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_homepage_section_slider_right_box_2_heading',
    array(
    'label'    => esc_html__( 'Slider Right Heading 2', 'omega-digital-store' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'omega_digital_store_homepage_section_slider_right_box_2_button',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_homepage_section_slider_right_box_2_button'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_homepage_section_slider_right_box_2_button',
    array(
    'label'    => esc_html__( 'Slider Right Button Title 2', 'omega-digital-store' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'omega_digital_store_homepage_section_slider_right_box_2_button_url',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_homepage_section_slider_right_box_2_button_url'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_homepage_section_slider_right_box_2_button_url',
    array(
    'label'    => esc_html__( 'Slider Right Button Url 2', 'omega-digital-store' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'omega_digital_store_homepage_section_shipping_title',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_homepage_section_shipping_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_homepage_section_shipping_title',
    array(
    'label'    => esc_html__( 'Free Shipping Title', 'omega-digital-store' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'omega_digital_store_homepage_section_shipping_text',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_homepage_section_shipping_text'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_homepage_section_shipping_text',
    array(
    'label'    => esc_html__( 'Free Shipping Text', 'omega-digital-store' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'omega_digital_store_homepage_section_exchange_title',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_homepage_section_exchange_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_homepage_section_exchange_title',
    array(
    'label'    => esc_html__( 'Return Exchange Title', 'omega-digital-store' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'omega_digital_store_homepage_section_exchange_text',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_homepage_section_exchange_text'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_homepage_section_exchange_text',
    array(
    'label'    => esc_html__( 'Return Exchange Text', 'omega-digital-store' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'omega_digital_store_homepage_section_support_title',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_homepage_section_support_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_homepage_section_support_title',
    array(
    'label'    => esc_html__( 'Quality Support Title', 'omega-digital-store' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'omega_digital_store_homepage_section_support_text',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_homepage_section_support_text'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_homepage_section_support_text',
    array(
    'label'    => esc_html__( 'Quality Support Text', 'omega-digital-store' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'omega_digital_store_homepage_section_shopping_title',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_homepage_section_shopping_title'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_homepage_section_shopping_title',
    array(
    'label'    => esc_html__( 'Safe Shopping Title', 'omega-digital-store' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'omega_digital_store_homepage_section_shopping_text',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_homepage_section_shopping_text'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_homepage_section_shopping_text',
    array(
    'label'    => esc_html__( 'Safe Shopping Text', 'omega-digital-store' ),
    'section'  => 'header_banner_setting',
    'type'     => 'text',
    )
);

// Product Settings

$wp_customize->add_section( 'product_column_setting',
    array(
    'title'      => esc_html__( 'Product Settings', 'omega-digital-store' ),
    'priority'   => 10,
    'capability' => 'edit_theme_options',
    'panel'      => 'omega_digital_store_theme_home_pannel',
    )
);

$wp_customize->add_setting('omega_digital_store_product_section',
    array(
        'default' => $omega_digital_store_default['omega_digital_store_product_section'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'omega_digital_store_sanitize_checkbox',
    )
);
$wp_customize->add_control('omega_digital_store_product_section',
    array(
        'label' => esc_html__('Enable Product Section', 'omega-digital-store'),
        'section' => 'product_column_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting( 'omega_digital_store_product_heading',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_product_heading'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_product_heading',
    array(
    'label'    => esc_html__( 'Section Heading', 'omega-digital-store' ),
    'section'  => 'product_column_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'omega_digital_store_product_button_text',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_product_button_text'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_product_button_text',
    array(
    'label'    => esc_html__( 'Button Text', 'omega-digital-store' ),
    'section'  => 'product_column_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'omega_digital_store_product_button_link',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_product_button_link'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'esc_url_raw',
    )
);
$wp_customize->add_control( 'omega_digital_store_product_button_link',
    array(
    'label'    => esc_html__( 'Button Link', 'omega-digital-store' ),
    'section'  => 'product_column_setting',
    'type'     => 'url',
    )
);

// Top Rated Item Heading

$wp_customize->add_setting( 'omega_digital_store_product_tab_1_heading',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_product_tab_1_heading'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_product_tab_1_heading',
    array(
    'label'    => esc_html__( 'Top Rated Item Heading', 'omega-digital-store' ),
    'section'  => 'product_column_setting',
    'type'     => 'text',
    )
);


// Top Rated Item Category

$omega_digital_store_args = array(
    'type'                     => 'product',
    'child_of'                 => 0,
    'parent'                   => '',
    'orderby'                  => 'term_group',
    'order'                    => 'ASC',
    'hide_empty'               => false,
    'hierarchical'             => 1,
    'number'                   => '',
    'taxonomy'                 => 'product_cat',
    'pad_counts'               => false
);

$omega_digital_store_categories = get_categories($omega_digital_store_args);
$omega_digital_store_cat_posts = array();
$omega_digital_store_m = 0;
$omega_digital_store_cat_posts[]='Select';
foreach($omega_digital_store_categories as $omega_digital_store_category){
    if($omega_digital_store_m==0){
        $default = $omega_digital_store_category->slug;
        $omega_digital_store_m++;
    }
    $omega_digital_store_cat_posts[$omega_digital_store_category->slug] = $omega_digital_store_category->name;
}

$wp_customize->add_setting('omega_digital_store_featured_product_top_rated',array(
    'default'   => '',
    'sanitize_callback' => 'omega_digital_store_sanitize_select',
));
$wp_customize->add_control('omega_digital_store_featured_product_top_rated',array(
    'type'    => 'select',
    'choices' => $omega_digital_store_cat_posts,
    'label' => __('Top Rated Item Category ','omega-digital-store'),
    'section' => 'product_column_setting',
));

// Most Selling Item Heading

$wp_customize->add_setting( 'omega_digital_store_product_tab_2_heading',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_product_tab_2_heading'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_product_tab_2_heading',
    array(
    'label'    => esc_html__( 'Most Selling Item Heading', 'omega-digital-store' ),
    'section'  => 'product_column_setting',
    'type'     => 'text',
    )
);

// Most Selling Item Category 

$omega_digital_store_args = array(
    'type'                     => 'product',
    'child_of'                 => 0,
    'parent'                   => '',
    'orderby'                  => 'term_group',
    'order'                    => 'ASC',
    'hide_empty'               => false,
    'hierarchical'             => 1,
    'number'                   => '',
    'taxonomy'                 => 'product_cat',
    'pad_counts'               => false
);

$omega_digital_store_categories = get_categories($omega_digital_store_args);
$omega_digital_store_cat_posts = array();
$omega_digital_store_m = 0;
$omega_digital_store_cat_posts[]='Select';
foreach($omega_digital_store_categories as $omega_digital_store_category){
    if($omega_digital_store_m==0){
        $default = $omega_digital_store_category->slug;
        $omega_digital_store_m++;
    }
    $omega_digital_store_cat_posts[$omega_digital_store_category->slug] = $omega_digital_store_category->name;
}

$wp_customize->add_setting('omega_digital_store_featured_product_most_selling',array(
    'default'   => '',
    'sanitize_callback' => 'omega_digital_store_sanitize_select',
));
$wp_customize->add_control('omega_digital_store_featured_product_most_selling',array(
    'type'    => 'select',
    'choices' => $omega_digital_store_cat_posts,
    'label' => __('Most Selling Item Category ','omega-digital-store'),
    'section' => 'product_column_setting',
));

// Most Viewed Item Heading

$wp_customize->add_setting( 'omega_digital_store_product_tab_3_heading',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_product_tab_3_heading'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_product_tab_3_heading',
    array(
    'label'    => esc_html__( 'Most Viewed Item Heading', 'omega-digital-store' ),
    'section'  => 'product_column_setting',
    'type'     => 'text',
    )
);

// Most Viewed Item Category

$omega_digital_store_args = array(
    'type'                     => 'product',
    'child_of'                 => 0,
    'parent'                   => '',
    'orderby'                  => 'term_group',
    'order'                    => 'ASC',
    'hide_empty'               => false,
    'hierarchical'             => 1,
    'number'                   => '',
    'taxonomy'                 => 'product_cat',
    'pad_counts'               => false
);

$omega_digital_store_categories = get_categories($omega_digital_store_args);
$omega_digital_store_cat_posts = array();
$omega_digital_store_m = 0;
$omega_digital_store_cat_posts[]='Select';
foreach($omega_digital_store_categories as $omega_digital_store_category){
    if($omega_digital_store_m==0){
        $default = $omega_digital_store_category->slug;
        $omega_digital_store_m++;
    }
    $omega_digital_store_cat_posts[$omega_digital_store_category->slug] = $omega_digital_store_category->name;
}

$wp_customize->add_setting('omega_digital_store_featured_product_most_viewed',array(
    'default'   => '',
    'sanitize_callback' => 'omega_digital_store_sanitize_select',
));
$wp_customize->add_control('omega_digital_store_featured_product_most_viewed',array(
    'type'    => 'select',
    'choices' => $omega_digital_store_cat_posts,
    'label' => __('Most Viewed Item Category ','omega-digital-store'),
    'section' => 'product_column_setting',
));

// Most Search Item Heading

$wp_customize->add_setting( 'omega_digital_store_product_tab_4_heading',
    array(
    'default'           => $omega_digital_store_default['omega_digital_store_product_tab_4_heading'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'omega_digital_store_product_tab_4_heading',
    array(
    'label'    => esc_html__( 'Most Search Item Heading', 'omega-digital-store' ),
    'section'  => 'product_column_setting',
    'type'     => 'text',
    )
);

// Most Search Item Category

$omega_digital_store_args = array(
    'type'                     => 'product',
    'child_of'                 => 0,
    'parent'                   => '',
    'orderby'                  => 'term_group',
    'order'                    => 'ASC',
    'hide_empty'               => false,
    'hierarchical'             => 1,
    'number'                   => '',
    'taxonomy'                 => 'product_cat',
    'pad_counts'               => false
);

$omega_digital_store_categories = get_categories($omega_digital_store_args);
$omega_digital_store_cat_posts = array();
$omega_digital_store_m = 0;
$omega_digital_store_cat_posts[]='Select';
foreach($omega_digital_store_categories as $omega_digital_store_category){
    if($omega_digital_store_m==0){
        $default = $omega_digital_store_category->slug;
        $omega_digital_store_m++;
    }
    $omega_digital_store_cat_posts[$omega_digital_store_category->slug] = $omega_digital_store_category->name;
}

$wp_customize->add_setting('omega_digital_store_featured_product_most_search',array(
    'default'   => '',
    'sanitize_callback' => 'omega_digital_store_sanitize_select',
));
$wp_customize->add_control('omega_digital_store_featured_product_most_search',array(
    'type'    => 'select',
    'choices' => $omega_digital_store_cat_posts,
    'label' => __('Most Search Item Category ','omega-digital-store'),
    'section' => 'product_column_setting',
));