<?php 
// E Product Categories SECTION START HERE 
/*============pRODICT CATEGORIES PANEL============*/
$wp_customize->add_section(
    'ecatproproduct_section',
    array(
        'title'         => __( 'Products Section 1', 'supermarket-ecommerce' ),
        'panel'   => 'lz_fitness_premium_home_panel',
    )
);
// ENABLE/DISABLE ecatproduct SECTION
$wp_customize->add_setting(
    'ecatproduct_section_disable',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default' => 'off'
    )
);
$wp_customize->add_control(
    new lz_fitness_Switch_Control(
        $wp_customize,
        'ecatproduct_section_disable',
        array(
            'settings'      => 'ecatproduct_section_disable',
            'section'       => 'ecatproproduct_section',
            'label'         => __( 'Disable Section', 'supermarket-ecommerce' ),
            'on_off_label'  => array(
                'on' => __( 'Yes', 'supermarket-ecommerce' ),
                'off' => __( 'No', 'supermarket-ecommerce' )
            )   
        )
    )
);

backgroundManager($wp_customize, 'ecatproduct', 'ecatproproduct_section', $color='#f7f5f6', get_template_directory_uri().'/images/default-gray.png', 'img');



lzCustomLable($wp_customize, 'ecatproductsection_padding', 'ecatproproduct_section', ' Section Padding Setting:');

$wp_customize->add_setting(
    'ecatproduct_toppadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '2em', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'ecatproduct_toppadding',
    array(
        'settings'      => 'ecatproduct_toppadding',
        'section'       => 'ecatproproduct_section',
        'type'          => 'text',
        'label'         => __( 'Section Top Padding', 'luzuk-premium' )
    )
);
$wp_customize->add_setting(
    'ecatproduct_bottompadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '2em', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'ecatproduct_bottompadding',
    array(
        'settings'      => 'ecatproduct_bottompadding',
        'section'       => 'ecatproproduct_section',
        'type'          => 'text',
        'label'         => __( 'Section Bottom Padding', 'luzuk-premium' )
    )
);
$wp_customize->add_setting(
    'ecatproduct_leftpadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '0px', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'ecatproduct_leftpadding',
    array(
        'settings'      => 'ecatproduct_leftpadding',
        'section'       => 'ecatproproduct_section',
        'type'          => 'text',
        'label'         => __( 'Section Left Padding', 'luzuk-premium' )
    )
);
$wp_customize->add_setting(
    'ecatproduct_rightpadding',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '0px', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'ecatproduct_rightpadding',
    array(
        'settings'      => 'ecatproduct_rightpadding',
        'section'       => 'ecatproproduct_section',
        'type'          => 'text',
        'label'         => __( 'Section Right Padding', 'luzuk-premium' )
    )
);



$wp_customize->add_setting(
    'lz_fitness_ecatproduct_title_sub_title_heading',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text'
    )
);
$wp_customize->add_control(
    new lz_fitness_Customize_Heading(
        $wp_customize,
        'lz_fitness_ecatproduct_title_sub_title_heading',
        array(
            'settings'      => 'lz_fitness_ecatproduct_title_sub_title_heading',
            'section'       => 'ecatproproduct_section',
            'label'         => __( 'Section Title', 'supermarket-ecommerce' ),
        )
    )
);   
$wp_customize->add_setting(
    'lz_fitness_ecatproduct_title',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( 'Electronic Products', 'supermarket-ecommerce' )
    )
);
$wp_customize->add_control(
    'lz_fitness_ecatproduct_title',
    array(
        'settings'      => 'lz_fitness_ecatproduct_title',
        'section'       => 'ecatproproduct_section',
        'type'          => 'text',
        'label'         => __( 'Title', 'supermarket-ecommerce' )
    )
);

// Heading color
addColorPalatOption($wp_customize, 'Eproduct_category_Heading_color', 'ecatproproduct_section', 'Heading color ', '#343748');

lzCustomLable($wp_customize, 'eproductbox_height', 'ecatproproduct_section', ' Product Height Setting:');

$wp_customize->add_setting(
    'eproduct_height',
    array(
        'sanitize_callback' => 'lz_fitness_sanitize_text',
        'default'           => __( '318px', 'luzuk-premium' )
    )
);
$wp_customize->add_control(
    'eproduct_height',
    array(
        'settings'      => 'eproduct_height',
        'section'       => 'ecatproproduct_section',
        'type'          => 'text',
        'label'         => __( 'Product Height', 'luzuk-premium' )
    )
);



//FEATURED PAGES
for( $i = 1; $i <2; $i++ ){

    $wp_customize->add_setting(
        'Eproduct_category_header'.$i,
        array(
            'sanitize_callback' => 'lz_fitness_sanitize_text'
        )
    );
    $wp_customize->add_control(
        new lz_fitness_Customize_Heading(
            $wp_customize,
            'Eproduct_category_header'.$i,
            array(
                'settings'      => 'Eproduct_category_header'.$i,
                'section'       => 'ecatproproduct_section',
                'label'         => __( 'Product Category Image '.$i, 'supermarket-ecommerce' )
            )
        )
    );

    lzAddImageElement($wp_customize, 'eproduct_category_image'.$i, 'ecatproproduct_section', $label="Recommended Image Size: 600X200px");

    

    lzAddElement($wp_customize, 'eproduct_catelauge_url_'.$i, 'ecatproproduct_section', $type = 'text', $label="Image Link", $callback ='esc_url', $default='Add link here');

}

$choices = getWooCategories($isObject = false, $id=0, $isParents = 0);

// print_r($choices);

lzCheckBoxElement($wp_customize, 'lz_fitness_ecatproduct_categories', 'ecatproproduct_section', $choices, $default=0, $label=__('Please select the Categories to show', 'supermarket-ecommerce'));


// Product title color
addColorPalatOption($wp_customize, 'Eproduct_category_title_color', 'ecatproproduct_section', 'Product title color ', '#353535');


// Product Reguler price color
addColorPalatOption($wp_customize, 'Eproduct_category_proregulerprice_color', 'ecatproproduct_section', 'Product reguler price color ', '#353535');


// Product sale price color
addColorPalatOption($wp_customize, 'Eproduct_category_prosaleingprice_color', 'ecatproproduct_section', 'Product sale price color ', '#605da6');


// Product bg color
addColorPalatOption($wp_customize, 'Eproduct_category_probg_color', 'ecatproproduct_section', 'Product background color ', '#fff');

// Product border color
addColorPalatOption($wp_customize, 'Eproduct_category_proborder_color', 'ecatproproduct_section', 'Product border color ', '#e0e0e0');


// Product box background color
addColorPalatOption($wp_customize, 'Eproduct_category_proboxbg_color', 'ecatproproduct_section', ' Product box background color ', '#fff');