<?php
/**
 * Compare Icon Widget - Content Controls
 *
 * @package GGM_Commerce
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

// $this is the GGM_Commerce_Widget_Compare_Icon instance.

$this->start_controls_section(
	'section_content',
	array(
		'label' => 'Content',
		'tab'   => \Elementor\Controls_Manager::TAB_CONTENT,
	)
);

$this->add_control(
	'icon',
	array(
		'label'   => 'Icon',
		'type'    => \Elementor\Controls_Manager::ICONS,
		'default' => array(
			'value'   => 'eicon-exchange',
			'library' => 'eicons',
		),
	)
);

$this->add_control(
	'show_count',
	array(
		'label'        => 'Show Count',
		'type'         => \Elementor\Controls_Manager::SWITCHER,
		'default'      => 'yes',
		'label_on'     => 'Show',
		'label_off'    => 'Hide',
		'return_value' => 'yes',
	)
);

$this->add_control(
	'link_to_compare',
	array(
		'label'        => 'Link to Comparison Page',
		'type'         => \Elementor\Controls_Manager::SWITCHER,
		'default'      => 'yes',
		'label_on'     => 'Yes',
		'label_off'    => 'No',
		'return_value' => 'yes',
	)
);

$this->add_control(
	'compare_page',
	array(
		'label'       => 'Comparison Page',
		'type'        => \Elementor\Controls_Manager::URL,
		'placeholder' => '/product-comparison/',
		'default'     => array(
			'url' => '',
		),
		'description' => 'Leave empty to use the default comparison page',
		'condition'   => array(
			'link_to_compare' => 'yes',
		),
	)
);

$this->end_controls_section();
