<?php


/** General Settings */
$wp_customize->add_section('store_expert_general_settings', array(
    'title' => esc_html__('General Settings', 'store-expert'),
    'priority' => 2
));


/** Box or wide layount */
$wp_customize->add_setting( 'store_expert_website_layout',
	array(
		'default' => 'wide',
		'transport' => 'refresh',
		'sanitize_callback' => 'store_expert_text_sanitization'
	)
);
$wp_customize->add_control( new Store_Expert_Text_Radio_Button_Custom_Control( $wp_customize, 'store_expert_website_layout',
	array(
		'label' => __( 'Website Layout', 'store-expert' ),
		'description' => esc_html__( '', 'store-expert' ),
		'section' => 'store_expert_general_settings',
		'choices' => array(
			'wide' => __( 'Wide', 'store-expert' ), 
			'boxed' => __( 'Boxed', 'store-expert' ),
		)
	)
) );

/** Primary colour*/
$wp_customize->add_setting( 'store_expert_primary_colour',
	array(
		'default' => '#0390a1',
		'transport' => 'refresh',
		'sanitize_callback' => 'store_expert_hex_rgba_sanitization'
	)
);
$wp_customize->add_control( new Store_Expert_Customize_Alpha_Color_Control( $wp_customize, 'store_expert_primary_colour',
	array(
		'label' => __( 'Primary Colour', 'store-expert' ),
		'description' => esc_html__( '', 'store-expert' ),
		'section' => 'store_expert_general_settings',
		'show_opacity' => true, // Optional. Show or hide the opacity value on the opacity slider handle. Default: true
		'palette' => array( // Optional. Select the colours for the colour palette . Default: WP color control palette
			'#8FD0CA',
			'#4579AE',
			'#0EA7A5',
			'#50C878',
			'#008080',
			'#fa4f26',
			'#1571c1',
			'#8309e7'
		)
	)
) );
/** Seperator */
$wp_customize->add_setting('store_expert_layout_seperator',
	array(
		'sanitize_callback' => 'store_expert_text_sanitization'
	)
);

$wp_customize->add_control(new Store_Expert_Separator($wp_customize, 'store_expert_layout_seperator',
	array(
		'section' => 'store_expert_general_settings'
	)
));


/** Pre Loader */
$wp_customize->add_setting( 'store_expert_preloader_control',
	array(
		'default' => 1,
		'transport' => 'refresh',
		'sanitize_callback' => 'store_expert_switch_sanitization'
	)
);
$wp_customize->add_control( new Store_Expert_Toggle_Switch_Custom_control( $wp_customize, 'store_expert_preloader_control',
	array(
		'label' => esc_html__( 'Preloader', 'store-expert' ),
		'section' => 'store_expert_general_settings',
		'description' => esc_html__( 'A simplle animation shows while your website loading', 'store-expert' ),
	)
) );

//upgrade to pro notice
$wp_customize->add_setting( 'store_expert_preloader_pro',
	array(
		'default' => '',
		'transport' => 'postMessage',
		'sanitize_callback' => 'store_expert_text_sanitization'
	)
);
$wp_customize->add_control( new Store_Expert_Simple_Notice_Custom_control( $wp_customize, 'store_expert_preloader_pro',
	array(
		'label' => __( '', 'store-expert' ),
		'description' => __( '- 15 Predesigned Preloaders. <br> - Preloader and Background Color Customization <br> - Coupon 10PERCENTOFF to get 10% off <br><a href="https://www.ammuthemes.com/downloads/store-expert-pro/" target="_blank">Upgrade to Pro </a>', 'store-expert' ),
		'section' => 'store_expert_general_settings'
	)
) );

/** Back to Top button */
$wp_customize->add_setting( 'store_expert_back_to_top',
	array(
		'default' => 1,
		'transport' => 'refresh',
		'sanitize_callback' => 'store_expert_switch_sanitization'
	)
);
$wp_customize->add_control( new Store_Expert_Toggle_Switch_Custom_control( $wp_customize, 'store_expert_back_to_top',
	array(
		'label' => esc_html__( 'Show Back to Top Button', 'store-expert' ),
		'section' => 'store_expert_general_settings',
		'description' => esc_html__( 'Back to top button helps to go top easily whithout scrolling', 'store-expert' ),
	)
) );

//upgrade to pro notice
$wp_customize->add_setting( 'store_expert_backtotop_pro',
	array(
		'default' => '',
		'transport' => 'postMessage',
		'sanitize_callback' => 'store_expert_text_sanitization'
	)
);
$wp_customize->add_control( new Store_Expert_Simple_Notice_Custom_control( $wp_customize, 'store_expert_backtotop_pro',
	array(
		'label' => __( '', 'store-expert' ),
		'description' => __( '- Customization for button colors, type, size, position & many more <br> - Coupon 10PERCENTOFF to get 10% off <br><a href="https://www.ammuthemes.com/downloads/store-expert-pro/" target="_blank">Upgrade to Pro </a>', 'store-expert' ),
		'section' => 'store_expert_general_settings'
	)
) );

/** Seperator */
$wp_customize->add_setting( 'store_expert_background_seperator',
	array(
		'sanitize_callback' => 'store_expert_text_sanitization'
	)
);

$wp_customize->add_control(new Store_Expert_Separator($wp_customize, 'store_expert_background_seperator',
	array(
		'section' => 'store_expert_general_settings'
	)
));



$wp_customize->get_control('background_color')->section = 'store_expert_general_settings';
$wp_customize->get_control('background_image')->section = 'store_expert_general_settings';
$wp_customize->get_control('background_preset')->section = 'store_expert_general_settings';
$wp_customize->get_control('background_position')->section = 'store_expert_general_settings';
$wp_customize->get_control('background_size')->section = 'store_expert_general_settings';
$wp_customize->get_control('background_repeat')->section = 'store_expert_general_settings';
$wp_customize->get_control('background_attachment')->section = 'store_expert_general_settings';

$wp_customize->get_control('background_color')->priority = 20;
$wp_customize->get_control('background_image')->priority = 20;
$wp_customize->get_control('background_preset')->priority = 20;
$wp_customize->get_control('background_position')->priority = 20;
$wp_customize->get_control('background_size')->priority = 20;
$wp_customize->get_control('background_repeat')->priority = 20;
$wp_customize->get_control('background_attachment')->priority = 20;

//upgrade to pro notice
$wp_customize->add_setting( 'store_expert_general_settings_pro',
	array(
		'default' => '',
		'transport' => 'postMessage',
		'sanitize_callback' => 'store_expert_text_sanitization',		
	)
);
$wp_customize->add_control( new Store_Expert_Simple_Notice_Custom_control( $wp_customize, 'store_expert_general_settings_pro',
	array(
		'label' => __( '', 'store-expert' ),
		'description' => __( '- Typography settings to change font, color, size of texts and headings <br> - Change side bar to right or left <br>- Coupon 10PERCENTOFF to get 10% off <br><a href="https://www.ammuthemes.com/downloads/store-expert-pro/" target="_blank">Upgrade to Pro </a>', 'store-expert' ),
		'section' => 'store_expert_general_settings',
		'priority' => 30,
	)
) );