<?php

// START PRICING SECTION 
    $wp_customize->add_section('lz_fitness_premium_pricing_section',array('title' => __( 'Pricing 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='#f4f4f4');

    $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'         => __( 'Pricing Title & Text', 'lz-fitness-premium' ),
            )
        )
    );    
    $wp_customize->add_setting('lz_fitness_pricing_title',array('sanitize_callback' => 'lz_fitness_sanitize_text','default' => __( 'Pricing Section', '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' )
        )
    );


// Heading color
addColorPalatOption($wp_customize, 'lz_fitness_plan_HeadingColor', 'lz_fitness_premium_pricing_section', 'Heading color', '#2b2b2b');
// Text color
addColorPalatOption($wp_customize, 'lz_fitness_plan_TextColor', 'lz_fitness_premium_pricing_section', 'Text color', '#4d4d4d');

    $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' ),
                )
            )
        ); 
        $wp_customize->add_setting('lz_fitness_pricing_plan_name_'.$i,array('sanitize_callback' => 'lz_fitness_sanitize_text','default' => __( 'Plan Name', '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' => 'text',
                'label' => __( 'Plan Name', 'lz-fitness-premium' )
            )
        );
        $wp_customize->add_setting('lz_fitness_pricing_plan_price_'.$i,array('sanitize_callback' => 'lz_fitness_sanitize_text','default' => __( '$', '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' )
            )
        );
        $wp_customize->add_setting('lz_fitness_pricing_plan_content_'.$i,array('sanitize_callback' => 'lz_fitness_sanitize_text','default' => __( '<ul><li>This is dummy text </li><li>This is dummy text </li><li>This is dummy text </li><li>This is dummy text </li><li>This is dummy text </li><li>This is dummy text </li></ul>', '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' )
            )
        );

        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');

    }
    // EDN PRICING SECTION 
    $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' ),
            )
        )
    );
