wuwanahq / wuwana2

🇪🇺 Wuwana v2 - A webapp to help users find local suppliers in Spain.
Mozilla Public License 2.0
2 stars 2 forks source link

Use suggestions on the homepage for zero result #171

Closed Nils85 closed 3 years ago

Nils85 commented 3 years ago

Use the same suggestions on the homepage for zero result pages. I added this to the homepage

<?php if ($companies['Counter'] > 0): ?>
    <section>
        <div class="search-title">
            <h2 style="margin:0"><?php echo TEXT[5] ?></h2>
            <div class="dropdown-caret mobile" onclick="showFilter()">
                <?php echo TEXT[14] ?>
                <img src="/static/icon/gray/chevron-down.svg" alt="">
            </div>
        </div>
        <div id="companies-list" class="box">
            <?php WebApp\ViewComponent::printCompanyCards($companies) ?>
        </div>
    </section>
    <input type="hidden" id="page-count" value="<?php echo $pageCount ?>"/>
    <a id="view-more-button" class="button-icon center" onclick="isPossibleToViewMore(<?php echo $jsParam ?>)">
        <img src="/static/icon/plus.svg" alt="">
        <?php echo TEXT[6] ?>
    </a>
<?php else: ?>
    <!-- TO DO: if 0 results, show suggestions similar to the 404 page -->
<?php endif ?>

Originally posted by @levogirar in https://github.com/wuwanahq/wuwana2/issues/70#issuecomment-808913112

Nils85 commented 3 years ago

I don't know how to integrate your idea in the homepage... Because the 404 page display a mini result space, so I'm guessing you want the same kind of result from the 404 page but displayed in full page like others results in the homepage. With the same paging system, without the message "Oops! It seems that we cannot find the page..." 🤔 At the end maybe you just wanted the current reslut page with the message "Did you mean?" before the companies list?

levogirar commented 3 years ago

Maybe it has to work differently. Something like "we didn't find anything, try these suggestions' And the suggestions are the same of the homepage.

In the future, we could make it more complex. Like, trending companies, new companies, companies in the same location, etc.

What do you think?