<?php
$this->start_controls_section(
    'content_section',
    [
        'label' => __('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,
        'default' => [],
    ]
);

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

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

$this->add_control(
    'layout_one_sec_sub_title',
    [
        'label' => __('Section Sub Title', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::TEXTAREA,
        '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(
    'post_count',
    [
        'label' => __('Number Of Posts', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['count'],
        'range' => [
            'count' => [
                'min' => 0,
                'max' => 11,
                'step' => 1,
            ],
        ],
        'default' => [
            'unit' => 'count',
            'size' => 6,
        ],
    ]
);

$this->add_control(
    'select_category',
    [
        'label' => __('Product Category', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::SELECT2,
        'options' => ostech_get_taxonoy('product_cat'),
    ]
);


$this->add_control(
    'query_order',
    [
        'label' => __('Select Order', 'ostech-addon'),
        'type' => \Elementor\Controls_Manager::SELECT2,
        'default' => 'DESC',
        'options' => [
            'DESC' => __('DESC', 'ostech-addon'),
            'ASC' => __('ASC', 'ostech-addon'),
        ]
    ]
);

$this->end_controls_section();
