<?php
if ($block->isSuggestionEnabled()): ?>

    <?php
    $dataHelper = $block->getDataHelper();
    $storeCode = $dataHelper->getCurrentStoreCode();
    $suggestion = $block->getSuggestion($storeCode);
    ?>

    <div id="els-suggest-results">
        <?php if ($suggestion != ""): ?>
            <h2>
                <em><?php echo __('Did you mean %1?', '<a href="' . $block->getQueryUrl($suggestion) . '">' . $suggestion . '</a>'); ?></em>
            </h2>
        <?php endif; ?>
    </div>
<?php endif; ?>

<script id="els-suggest-results-template" type="text/x-magento-template">
    <h2>
        <% _.each(suggest, function(doc) { // should always be 1 suggestion %>
        <em><?php echo __('Did you mean ') ?><a href="<%= ("<?= $block->getQueryUrl('%%') ?>").replace('%%',doc.text) %>"><%= doc.text %></a>?</em>
        <% }) %>
    </h2>
</script>


