<?php
/**
 * Product Barcode Widget - Content Controls
 *
 * @package GGM_Commerce
 */

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

// $this is the GGM_Commerce_Widget_Product_Barcode instance.

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

$this->add_control(
	'barcode_display',
	array(
		'label'   => 'Display',
		'type'    => \Elementor\Controls_Manager::SELECT,
		'default' => 'primary',
		'options' => array(
			'primary' => 'Primary Barcode Only',
			'all'     => 'All Barcodes',
		),
	)
);

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

$this->add_control(
	'show_barcode_image',
	array(
		'label'        => 'Show Barcode Image',
		'type'         => \Elementor\Controls_Manager::SWITCHER,
		'default'      => '',
		'label_on'     => 'Show',
		'label_off'    => 'Hide',
		'return_value' => 'yes',
		'description'  => 'Generate visual barcode (requires barcode library)',
	)
);

$this->add_control(
	'layout',
	array(
		'label'   => 'Layout',
		'type'    => \Elementor\Controls_Manager::SELECT,
		'default' => 'inline',
		'options' => array(
			'inline'  => 'Inline',
			'stacked' => 'Stacked',
			'table'   => 'Table',
		),
	)
);

$this->add_control(
	'label_text',
	array(
		'label'       => 'Label Text',
		'type'        => \Elementor\Controls_Manager::TEXT,
		'default'     => 'Barcode:',
		'placeholder' => 'Barcode:',
	)
);

$this->add_control(
	'hide_if_empty',
	array(
		'label'        => 'Hide if No Barcode',
		'type'         => \Elementor\Controls_Manager::SWITCHER,
		'default'      => 'yes',
		'label_on'     => 'Yes',
		'label_off'    => 'No',
		'return_value' => 'yes',
	)
);

$this->end_controls_section();
