<?php
/**
 * Discount Code Input Widget (Premium)
 *
 * A widget for customers to enter and apply discount codes during checkout.
 *
 * @package GGM_Commerce
 */

// If this file is called directly, abort.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

require_once __DIR__ . '/widget-discount-code-input/elementor-render.php';

/**
 * Class GGM_Commerce_Widget_Discount_Code_Input
 *
 * Premium widget for discount code input.
 */
class GGM_Commerce_Widget_Discount_Code_Input extends GGM_Commerce_Premium_Widget {

	/**
	 * Premium widget slug for license activation.
	 *
	 * @var string
	 */
	protected $premium_widget_slug = 'discount-vouchers';

	/**
	 * Get widget name.
	 *
	 * @return string Widget name.
	 */
	public function get_name() {
		return 'ggmc-discount-code-input';
	}

	/**
	 * Get widget title.
	 *
	 * @return string Widget title.
	 */
	public function get_title() {
		return 'Discount Code Input';
	}

	/**
	 * Get widget icon.
	 *
	 * @return string Widget icon.
	 */
	public function get_icon() {
		return 'eicon-price-table';
	}

	/**
	 * Get widget keywords.
	 *
	 * @return array Widget keywords.
	 */
	public function get_keywords() {
		return array( 'ggm', 'commerce', 'discount', 'coupon', 'voucher', 'code', 'promo', 'premium' );
	}

	/**
	 * Register widget controls.
	 */
	protected function register_controls() {
		require __DIR__ . '/widget-discount-code-input/elementor-controls.php';
		require __DIR__ . '/widget-discount-code-input/elementor-controls-style.php';
	}

	/**
	 * Render the premium widget content.
	 * This is called by the parent class after license verification.
	 */
	protected function render_premium_content() {
		ggmc_discount_code_input_render_premium_content( $this );
	}
}
