<?php
/**
 * Carts Tracked Tile
 *
 * @package     EDD\Pro\CartRecovery\Admin\Reports\Endpoints\Tiles
 * @copyright   Copyright (c) 2026, Sandhills Development, LLC
 * @license     https://opensource.org/licenses/gpl-2.0.php GNU Public License
 * @since       3.6.5
 */

namespace EDD\Pro\CartRecovery\Admin\Reports\Endpoints\Tiles;

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore

use EDD\Reports\Endpoints\Tiles\Tile;

/**
 * Carts Tracked Tile class.
 *
 * Displays the number of carts tracked in the selected date range.
 *
 * @since 3.6.5
 */
class CartsTracked extends Tile {
	use Traits\Carts;

	/**
	 * Gets the tile endpoint ID.
	 *
	 * @since 3.6.5
	 * @return string
	 */
	protected function get_id(): string {
		return 'acr_carts_tracked';
	}

	/**
	 * Gets the tile label for display.
	 *
	 * @since 3.6.5
	 * @return string
	 */
	protected function get_label(): string {
		return __( 'Carts Tracked', 'easy-digital-downloads' );
	}

	/**
	 * Gets the tooltip content for the tile.
	 *
	 * @since 3.6.5
	 * @return string
	 */
	protected function get_tooltip(): string {
		return __( 'Total number of carts tracked in the selected period.', 'easy-digital-downloads' );
	}

	/**
	 * Gets the number of carts tracked in the selected date range.
	 *
	 * @since 3.6.5
	 * @return int
	 */
	protected function get_data(): int {
		$stats = $this->get_cart_stats();

		return $stats['total_carts'];
	}
}
