<?php
/**
 * Counter Settings
 *
 * @package relax_spa
 */
add_action( 'customize_register', 'relax_spa_customize_price_section' );

function relax_spa_customize_price_section( $wp_customize ) {

    $wp_customize->add_section( 'relax_spa_pricing_table', array(
        'title' => esc_html__( 'Pricing Section', 'relax-spa'),
        'panel' => 'relax_spa_homepage_panel'
    ) );

    $wp_customize->add_setting( 'bs_tickets_display_option', array(
        'sanitize_callback' => 'relax_spa_sanitize_checkbox',
        'default' => true
    ) );

    $wp_customize->add_control( new Relax_Spa_Toggle_Control( $wp_customize, 'bs_tickets_display_option', array(
        'label' => esc_html__('Hide / Show', 'relax-spa'),
        'section' => 'relax_spa_pricing_table',
        'settings' => 'bs_tickets_display_option',
        'type'=> 'relax-spa-toggle',
    ) ) );

    $wp_customize->add_setting('bs_tickets_top_heading', array(
        'sanitize_callback' => 'sanitize_text_field',
        'default' => '',
        'transport' => 'postMessage',
    ));

    $wp_customize->add_control('bs_tickets_top_heading', array(
        'label' => esc_html__('Enter Top Heading for Price Table', 'relax-spa'),
        'section' => 'relax_spa_pricing_table',
        'type' => 'text',
    ));

    $wp_customize->add_setting('bs_tickets_heading', array(
        'sanitize_callback' => 'sanitize_text_field',
        'default' => '',
        'transport' => 'postMessage',
    ));

    $wp_customize->add_control('bs_tickets_heading', array(
        'label' => esc_html__('Enter Main Heading for Price Table', 'relax-spa'),
        'section' => 'relax_spa_pricing_table',
        'settings' => 'bs_tickets_heading',
        'type' => 'text',
    ));

    $wp_customize->selective_refresh->add_partial('bs_tickets_display_option', array(
        'selector' => '.pricing > .container', // You can also select a css class
    ));
    
}