<?php

// START PRICING SECTION 
    $wp_customize->add_section('lz_fitness_premium_pricing_section',array('title' => __( 'Pricing Plan Section', 'lz-fitness-premium' ),'panel' => 'lz_fitness_premium_home_panel'));
    // ENABLE/DISABLE PRISING SECTION
    $wp_customize->add_setting('lz_fitness_premium_pricing_section_disable',array('sanitize_callback' => 'lz_fitness_sanitize_text',)); 
    $wp_customize->add_control(
        new lz_fitness_Switch_Control(
            $wp_customize,
            'lz_fitness_premium_pricing_section_disable',
            array(
                'settings' => 'lz_fitness_premium_pricing_section_disable',
                'section' => 'lz_fitness_premium_pricing_section',
                'label' => __( 'Disable Section', 'lz-fitness-premium' ),
                'on_off_label'  => array('on' => __( 'Yes', 'lz-fitness-premium' ), 'off' => __( 'No', 'lz-fitness-premium' )),
            )
        )
    );

backgroundManager($wp_customize, 'pricing', 'lz_fitness_premium_pricing_section', $color='#ffffff');

$wp_customize->add_setting('lz_fitness_pricing_title_heading',array('sanitize_callback' => 'lz_fitness_sanitize_text'));
$wp_customize->add_control(
    new lz_fitness_Customize_Heading(
        $wp_customize,
        'lz_fitness_pricing_title_heading',
        array(
            'settings'      => 'lz_fitness_pricing_title_heading',
            'section'       => 'lz_fitness_premium_pricing_section',
            'label'         => __( 'Section Title & Sub Title', 'lz-fitness-premium' ),
        )
    )
);    

$wp_customize->add_setting('lz_fitness_pricing_title',array('sanitize_callback' => 'lz_fitness_sanitize_text','default' => __( 'PRICING PLAN', 'lz-fitness-premium' )));
$wp_customize->add_control(
    'lz_fitness_pricing_title',
    array(
        'settings'      => 'lz_fitness_pricing_title',
        'section'       => 'lz_fitness_premium_pricing_section',
        'type'          => 'text',
        'label'         => __( 'Title for section', 'lz-fitness-premium' )
    )
);
    /*$wp_customize->add_setting('lz_fitness_pricing_text',array('sanitize_callback'=>'lz_fitness_sanitize_text','default'=> __('Here goes the short description for the section', 'lz-fitness-premium')));
    $wp_customize->add_control(
        'lz_fitness_pricing_text',
        array(
            'settings' =>'lz_fitness_pricing_text',
            'section' => 'lz_fitness_premium_pricing_section',
            'type'=> 'textarea',
            'label'=> __('Content for the section', 'lz-fitness-premium')
        )
    );*/
$wp_customize->add_setting('lz_fitness_pricing_Subhedingtitle',array('sanitize_callback' => 'lz_fitness_sanitize_text','default' => __( 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit', 'lz-fitness-premium' )));
    $wp_customize->add_control(
        'lz_fitness_pricing_Subhedingtitle',
        array(
            'settings'      => 'lz_fitness_pricing_Subhedingtitle',
            'section'       => 'lz_fitness_premium_pricing_section',
            'type'          => 'textarea',
            'label'         => __( 'Sub Title for section', 'lz-fitness-premium' )
        )
    );

    $wp_customize->add_setting('lz_fitness_pricing_npp_heading',array('sanitize_callback' => 'lz_fitness_sanitize_text'));
    $wp_customize->add_control(
        new lz_fitness_Customize_Heading(
            $wp_customize,
            'lz_fitness_pricing_npp_heading',
            array(
                'settings'      => 'lz_fitness_pricing_npp_heading',
                'section'       => 'lz_fitness_premium_pricing_section',
                'label'         => __( 'Number Of Pricing Plans', 'lz-fitness-premium' ),
            )
        )
    );    
    $wp_customize->add_setting('lz_fitness_pricing_npp_count',array('sanitize_callback' => 'lz_fitness_sanitize_text','default' => 2));
    $wp_customize->add_control(
        'lz_fitness_pricing_npp_count',
        array(
            'settings'      => 'lz_fitness_pricing_npp_count',
            'section'       => 'lz_fitness_premium_pricing_section',
            'type'          => 'select',
            'label'         => __( 'Number of plan to show', 'lz-fitness-premium' ),
            'choices'=>array(1,2,3,4)
        )
    );

    for($i=1;$i<=4;$i++){
        $wp_customize->add_setting('lz_fitness_pricing_plan_heading_'.$i,array('sanitize_callback' => 'lz_fitness_sanitize_text'));
        $wp_customize->add_control(
            new lz_fitness_Customize_Heading(
                $wp_customize,
                'lz_fitness_pricing_plan_heading_'.$i,
                array(
                    'settings' => 'lz_fitness_pricing_plan_heading_'.$i,
                    'section' => 'lz_fitness_premium_pricing_section',
                    'label' => __( 'Plan'.$i, 'lz-fitness-premium' ),
                )
            )
        ); 

        
    //lzAddElementSeparator($wp_customize, 'lz_fitness_premium_pricing_section', 'lz_fitness_premium_pricing_section');


        $wp_customize->add_setting('lz_fitness_pricing_planheadline_'.$i,array('sanitize_callback' => 'lz_fitness_sanitize_text','default' => __( 'LIMITED TIME OFFER', 'lz-fitness-premium' )));
        $wp_customize->add_control(
            'lz_fitness_pricing_planheadline_'.$i,
            array(
                'settings' => 'lz_fitness_pricing_planheadline_'.$i,
                'section' => 'lz_fitness_premium_pricing_section',
                'type' => 'text',
                'label' => __( 'Pricing Plan name', 'lz-fitness-premium' )
            )
        );
        $wp_customize->add_setting('lz_fitness_pricing_plan_name_'.$i,array('sanitize_callback' => 'lz_fitness_sanitize_text','default' => __( 'YOUR FIRST', 'lz-fitness-premium' )));
        $wp_customize->add_control(
            'lz_fitness_pricing_plan_name_'.$i,
            array(
                'settings' => 'lz_fitness_pricing_plan_name_'.$i,
                'section' => 'lz_fitness_premium_pricing_section',
                'type' => 'textarea',
                'label' => __( 'About Plan', 'lz-fitness-premium' )
            )
        );
        $wp_customize->add_setting('lz_fitness_pricing_plancontent_'.$i,array('sanitize_callback' => 'lz_fitness_sanitize_text','default' => __( '5 CLASSES', 'lz-fitness-premium' )));
        $wp_customize->add_control(
            'lz_fitness_pricing_plancontent_'.$i,
            array(
                'settings' => 'lz_fitness_pricing_plancontent_'.$i,
                'section' => 'lz_fitness_premium_pricing_section',
                'type' => 'textarea',
                'label' => __( 'Plan Text', 'lz-fitness-premium' )
            )
        );
$wp_customize->add_setting('lz_fitness_pricing_plan_price_'.$i,array('sanitize_callback' => 'lz_fitness_sanitize_text','default' => __( '$29', 'lz-fitness-premium' )));
$wp_customize->add_control(
    'lz_fitness_pricing_plan_price_'.$i,
    array(
        'settings' => 'lz_fitness_pricing_plan_price_'.$i,
        'section' => 'lz_fitness_premium_pricing_section',
        'type' => 'text',
        'label' => __( 'Plan price', 'lz-fitness-premium' )
    )
);
 
lzAddElement($wp_customize, 'pricing_plan_url_'.$i, 'lz_fitness_premium_pricing_section', $type = 'text', $label="Add Link for plan".$i."&nbsp;if plan selected", $callback ='esc_url', $default='Add link here');
        
$wp_customize->add_setting('lz_fitness_pricing_plan_content_'.$i,array('sanitize_callback' => 'lz_fitness_sanitize_text','default' => __( 'Must use within 2 weeks', 'lz-fitness-premium' )));
$wp_customize->add_control(
    'lz_fitness_pricing_plan_content_'.$i,
    array(
        'settings' => 'lz_fitness_pricing_plan_content_'.$i,
        'section' => 'lz_fitness_premium_pricing_section',
        'type' => 'textarea',
        'label' => __( 'Plan Content', 'lz-fitness-premium' )
    )
);



addColorPalatOption($wp_customize, 'pages_CoursesFColor'.$i, 'lz_fitness_premium_pricing_section', 'Plan name box background color', '#69489d');
addColorPalatOption($wp_customize, 'pages_CoursesBColor'.$i, 'lz_fitness_premium_pricing_section', 'Plan Box border Color', '#69489d');
        
}


$wp_customize->add_setting('lz_fitness_pricing_shortcode', array('sanitize_callback'=>'lz_fitness_sanitize_text'));
$wp_customize->add_control(
    new lz_fitness_Info_Text( 
        $wp_customize,
        'lz_fitness_pricing_shortcode',
        array(
            'settings'      => 'lz_fitness_pricing_shortcode',
            'section'       => 'lz_fitness_premium_pricing_section',
            'label'         => __( 'Note:', 'lz-fitness-premium' ), 
            'description'   => __( 'Just place the shortcode <strong>"[PLAN_PRICING]"</strong> in your page to show the Pricing in a page ', 'lz-fitness-premium' ),
        )
    )
);

addColorPalatOption($wp_customize, 'lz_fitness_plan_HeadingColor', 'lz_fitness_premium_pricing_section', 'Heading Color', '#ffffff');

addColorPalatOption($wp_customize, 'lz_fitness_plan_SpanHeadingColor', 'lz_fitness_premium_pricing_section', 'Sub Heading Color', '#2b2b2b');

addColorPalatOption($wp_customize, 'lz_fitness_plan_spanBackgroundColor', 'lz_fitness_premium_pricing_section', 'Heading Background Color', '#69489d');

addColorPalatOption($wp_customize, 'lz_fitness_plan_spanoulineHeadingColor', 'lz_fitness_premium_pricing_section', 'Outline Color', '#69489d');

addColorPalatOption($wp_customize, 'lz_fitness_plan_OfferTextColor', 'lz_fitness_premium_pricing_section', 'Pricing Plan Name Color', '#ffffff');

addColorPalatOption($wp_customize, 'lz_fitness_plan_OfferPlanTextColor', 'lz_fitness_premium_pricing_section', 'Plan Text Color', '#2b2b2b');

addColorPalatOption($wp_customize, 'lz_fitness_plan_OfferPlanboldTextColor', 'lz_fitness_premium_pricing_section', 'Plan Bold Text Color', '#2b2b2b');

addColorPalatOption($wp_customize, 'lz_fitness_plan_PriceTextColor', 'lz_fitness_premium_pricing_section', 'Plan Price Text Color', '#69489d');


$wp_customize->add_setting(
    'pricebtntxt',
    array(
        'sanitize_callback'=>'lz_fitness_sanitize_text',
        'default'=> __('BUY NOW', 'lz-fitness-premium')
    )
);
$wp_customize->add_control(
    'pricebtntxt',
    array(
        'settings' =>'pricebtntxt',
        'section' => 'lz_fitness_premium_pricing_section',
        'type'=> 'text',
        'label'=> __('Button Text', 'lz-fitness-premium')
    )
);
addColorPalatOption($wp_customize, 'lz_fitness_plan_buttonBackgroundColor', 'lz_fitness_premium_pricing_section', 'Button Background Color', '#69489d');

addColorPalatOption($wp_customize, 'lz_fitness_plan_buttontextColor', 'lz_fitness_premium_pricing_section', 'Button Text Color', '#ffffff');

addColorPalatOption($wp_customize, 'lz_fitness_plan_ContentColor', 'lz_fitness_premium_pricing_section', 'plan Content color', '#2b2b2b');

addColorPalatOption($wp_customize, 'lz_fitness_plan_BoxColor', 'lz_fitness_premium_pricing_section', 'plan Box Background Color', '#f6fbfa');
