<?php
/**
 * Recently Viewed Products Widget (Premium)
 *
 * Displays products the customer has recently viewed.
 *
 * @package GGM_Commerce
 */

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

require_once __DIR__ . '/widget-recently-viewed/elementor-render.php';

/**
 * Class GGM_Commerce_Widget_Recently_Viewed
 *
 * Premium widget for displaying recently viewed products.
 */
class GGM_Commerce_Widget_Recently_Viewed extends GGM_Commerce_Premium_Widget {

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

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

	/**
	 * Get widget title.
	 *
	 * @return string Widget title.
	 */
	public function get_title() {
		return 'Recently Viewed Products';
	}

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

	/**
	 * Get widget keywords.
	 *
	 * @return array Widget keywords.
	 */
	public function get_keywords() {
		return array( 'ggm', 'commerce', 'recently', 'viewed', 'history', 'products', 'premium' );
	}

	/**
	 * Get static default styles for this widget.
	 *
	 * @return array Default styles.
	 */
	public static function get_static_default_styles() {
		return self::get_defaults_from_config();
	}

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

	/**
	 * Render the premium content.
	 */
	protected function render_premium_content() {
		ggmc_recently_viewed_render_premium_content( $this );
	}
}
