Smile-SA/elasticsuite

View on GitHub
src/module-elasticsuite-analytics/view/adminhtml/templates/search/usage/kpi.phtml

Summary

Maintainability
Test Coverage
<?php
/**
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer
 * versions in the future.
 *
 * @category  Smile
 * @package   Smile\ElasticsuiteAnalytics
 * @author    Richard Bayet <richard.bayet@smile.fr>
 * @copyright 2020 Smile
 * @license   Open Software License ("OSL") v. 3.0
 */
?>

<?php
/**
 * @var Smile\ElasticsuiteAnalytics\Block\Adminhtml\Search\Usage\Kpi $block
 */

$data = $block->getKpi();
?>

<div class="dashboard-main col-m-11">
    <div class="dashboard-totals">
        <?php if (empty($data)) : ?>
            <div class="empty-text" style="width:100%; text-align:center">
                <em><?= __('No data over the selected period.'); ?></em>
            </div>
        <?php else : ?>
        <ul class="dashboard-totals-list">
            <li class="dashboard-totals-item">
                <span class="dashboard-totals-label"><?= __('Searches') ?></span>
                <strong class="dashboard-totals-value">
                    <span class="value"><?= $data['search_page_views_count']; ?></span>
                    <span class="dashboard-totals-decimals"></span>
                </strong>
            </li>
            <li class="dashboard-totals-item">
                <span class="dashboard-totals-label"><?= __('Page views') ?></span>
                <strong class="dashboard-totals-value">
                    <span class="value"><?= $data['page_views_count']; ?></span>
                    <span class="dashboard-totals-decimals"></span>
                </strong>
            </li>
            <li class="dashboard-totals-item">
                <span class="dashboard-totals-label"><?= __('Category views') ?></span>
                <strong class="dashboard-totals-value">
                    <span class="value"><?= $data['category_views_count']; ?></span>
                    <span class="dashboard-totals-decimals"></span>
                </strong>
            </li>
            <li class="dashboard-totals-item">
                <span class="dashboard-totals-label"><?= __('Product views') ?></span>
                <strong class="dashboard-totals-value">
                    <span class="value"><?= $data['product_views_count']; ?></span>
                    <span class="dashboard-totals-decimals"></span>
                </strong>
            </li>
            <li class="dashboard-totals-item">
                <span class="dashboard-totals-label"><?= __('Products added to cart') ?></span>
                <strong class="dashboard-totals-value">
                    <span class="value"><?= $data['add_to_cart_count']; ?></span>
                    <span class="dashboard-totals-decimals"></span>
                </strong>
            </li>
            <li class="dashboard-totals-item">
                <span class="dashboard-totals-label"><?= __('Sales') ?></span>
                <strong class="dashboard-totals-value">
                    <span class="value"><?= $data['sales_count']; ?></span>
                    <span class="dashboard-totals-decimals"></span>
                </strong>
            </li>
            <li class="dashboard-totals-item">
                <span class="dashboard-totals-label"><?= __('Visitors') ?></span>
                <strong class="dashboard-totals-value">
                    <span class="value"><?= $data['visitors_count']; ?></span>
                    <span class="dashboard-totals-decimals"></span>
                </strong>
            </li>
            <li class="dashboard-totals-item">
                <span class="dashboard-totals-label"><?= __('Sessions') ?></span>
                <strong class="dashboard-totals-value">
                    <span class="value"><?= $data['sessions_count']; ?></span>
                    <span class="dashboard-totals-decimals"></span>
                </strong>
            </li>
            <li class="dashboard-totals-item">
                <span class="dashboard-totals-label"><?= __('Sessions with search') ?></span>
                <strong class="dashboard-totals-value">
                    <span class="value"><?= $data['search_sessions_count']; ?></span>
                    <span class="dashboard-totals-decimals"></span>
                </strong>
            </li>
            <li class="dashboard-totals-item">
                <span class="dashboard-totals-label"><?= __('Searches per session') ?></span>
                <strong class="dashboard-totals-value">
                    <span class="value"><?= $data['search_usage_rate']; ?></span>
                    <span class="dashboard-totals-decimals"></span>
                </strong>
            </li>
        </ul>
        <?php endif; ?>
    </div>
</div>