<?php

$this->start_controls_section(
    'content_section',
    [
        'label' => __('Pricing Content', 'ostech-addon'),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
        'condition' => [
            'layout_type' => 'layout_one'
        ]
    ]
);

$this->add_control(
    'layout_one_title_image',
    [
        'label' => __('Title Image', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::MEDIA,
    ]
);

$this->add_control(
    'sec_title',
    [
        'label' => __('Section Title', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'rows' => '2',
        'placeholder' => __('Add title', 'ostech-addon'),
        'default' => __('Default Title', 'ostech-addon'),
    ]
);

ostech_elementor_heading_option($this, 'Section Title', 'h3', 'layout_one');

$this->add_control(
    'sec_sub_title',
    [
        'label' => __('Section Sub Title', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'rows' => '2',
        'placeholder' => __('Add sub title', 'ostech-addon'),
        'default' => __('Default Sub Title', 'ostech-addon'),
    ]
);

ostech_elementor_heading_option($this, 'Section Sub Title', 'h6', 'layout_one');

$this->add_control(
    'pricing_layout_one_pricing_divider',
    [
        'type' => \Elementor\Controls_Manager::DIVIDER,
    ]
);

$this->add_control(
    'monthly_heading',
    [
        'label' => __('Monthly Heading', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'placeholder' => __('Monthly', 'ostech-addon'),
        'default' => __('Monthly', 'ostech-addon'),
    ]
);

$this->add_control(
    'yearly_heading',
    [
        'label' => __('Yearly Heading', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'placeholder' => __('Yearly', 'ostech-addon'),
        'default' => __('Yearly', 'ostech-addon'),
    ]
);

$pricing_monthly_list = new \Elementor\Repeater();

$pricing_monthly_list->add_control(
    'package_status',
    [
        'label' => __('Plan Recommended', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'placeholder' => __('Default Recommended', 'ostech-addon'),
        'default' => __('Recommended', 'ostech-addon'),
    ]
);

$pricing_monthly_list->add_control(
    'plan_title',
    [
        'label' => __('Plan Title', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'rows' => '2',
        'default' => __('WEBSITE DESIGN', 'ostech-addon'),
    ]
);

$pricing_monthly_list->add_control(
    'price_sign',
    [
        'label' => __('Price', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'label_block' => true,
        'default' => __('$', 'ostech-addon'),
    ]
);
$pricing_monthly_list->add_control(
    'price',
    [
        'label' => __('Price', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'label_block' => true,
        'default' => __('30.', 'ostech-addon'),
    ]
);
$pricing_monthly_list->add_control(
    'price_decimal',
    [
        'label' => __('Price', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'label_block' => true,
        'default' => __('00', 'ostech-addon'),
    ]
);

$pricing_monthly_list->add_control(
    'service_title_text',
    [
        'label' => __('Service Title Text', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'label_block' => true,
        'default' => __('All Services Include:', 'ostech-addon'),
    ]
);

$pricing_monthly_list->add_control(
    'service_list',
    [
        'label' => __('Service List', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::CODE,
        'label_block' => true,
        'default' => wp_kses('<li class="package-card__content__list__item"> <i class="icon-mark"></i>Social Media Marketing</li>', 'ostech_allowed_tags')
    ]
);

$pricing_monthly_list->add_control(
    'button_label',
    [
        'label' => __('Button Label', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => __('Apply Now', 'ostech-addon'),
        'label_block' => true,
    ]
);

$pricing_monthly_list->add_control(
    'url',
    [
        'label' => __('Url', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::URL,
        'placeholder' => __('#', 'ostech-addon'),
        'show_external' => false,
        'default' => [
            'url' => '#',
            'is_external' => false,
            'nofollow' => false,
        ],
        'show_label' => true,
    ]
);

$pricing_monthly_list->add_control(
    'shape',
    [
        'label' => __('Shape', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::MEDIA,
    ]
);

$this->add_control(
    'pricing_monthly_list',
    [
        'label' => __('Monthly List', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::REPEATER,
        'fields' => $pricing_monthly_list->get_controls(),
        'prevent_empty' => false,
        'title_field' => '{{{ plan_title }}}',
    ]
);

$this->add_control(
    'pricing_layout_one_divider',
    [
        'type' => \Elementor\Controls_Manager::DIVIDER,
    ]
);

$pricing_yearly_list = new \Elementor\Repeater();

$pricing_yearly_list->add_control(
    'package_status',
    [
        'label' => __('Plan Recommended', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'placeholder' => __('Default Recommended', 'ostech-addon'),
        'default' => __('Recommended', 'ostech-addon'),
    ]
);

$pricing_yearly_list->add_control(
    'plan_title',
    [
        'label' => __('Plan Title', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        'rows' => '2',
        'placeholder' => __('Default Plan', 'ostech-addon'),
        'default' => __('Default Plan', 'ostech-addon'),
    ]
);

$pricing_yearly_list->add_control(
    'price_sign',
    [
        'label' => __('Price', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'label_block' => true,
        'default' => __('$', 'ostech-addon'),
    ]
);
$pricing_yearly_list->add_control(
    'price',
    [
        'label' => __('Price', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'label_block' => true,
        'default' => __('30.', 'ostech-addon'),
    ]
);
$pricing_yearly_list->add_control(
    'price_decimal',
    [
        'label' => __('Price', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'label_block' => true,
        'default' => __('00', 'ostech-addon'),
    ]
);

$pricing_yearly_list->add_control(
    'service_title_text',
    [
        'label' => __('Service Title Text', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'label_block' => true,
        'default' => __('All Services Include:', 'ostech-addon'),
    ]
);


$pricing_yearly_list->add_control(
    'service_list',
    [
        'label' => __('Service List', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::CODE,
        'label_block' => true,
        'default' => wp_kses('<li class="package-card__content__list__item"> <i class="icon-mark"></i>Social Media Marketing</li>', 'ostech_allowed_tags')
    ]
);

$pricing_yearly_list->add_control(
    'button_label',
    [
        'label' => __('Button Label', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => __('Purchase Now', 'ostech-addon'),
        'label_block' => true,
    ]
);

$pricing_yearly_list->add_control(
    'url',
    [
        'label' => __('Url', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::URL,
        'placeholder' => __('#', 'ostech-addon'),
        'show_external' => false,
        'default' => [
            'url' => '#',
            'is_external' => false,
            'nofollow' => false,
        ],
        'show_label' => true,
    ]
);

$pricing_yearly_list->add_control(
    'shape',
    [
        'label' => __('Shape', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::MEDIA,
    ]
);

$this->add_control(
    'pricing_yearly_list',
    [
        'label' => __('Yearly List', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::REPEATER,
        'fields' => $pricing_yearly_list->get_controls(),
        'prevent_empty' => false,
        'title_field' => '{{{ plan_title }}}',
    ]
);

$this->end_controls_section();
