Recommendations

FAQ

Frequently asked questions about Clerk.io Recommendations.

Hide Category slider #

When a Clerk.io Recommendation is added to a category page that contains a low amount of products, it will show the same products on the page.

To avoid this, you can hide the Recommendation on category pages, by adding an if statement to the Recommendation design code.

Change the number in the if statement to the minimum amount of products needed to show the Recommendation.

{% if products.length > 7 %}
 
 <!-- Recommendation code -->

{% endif %}

E.g.:

{% if products.length > 7 %}
<div class="clerk-wrapper">
    <div class="clerk-headline-wrapper">
        <h2 class="clerk-headline">{{headline}}</h2>
    </div>
    <div class="clerk-slider-wrapper">
        <div class="clerk-slider">
            {% for item in products %}
            <div class="clerk-slider-content">
                <!-- START PRODUCT CARD -->
                <!-- END PRODUCT CARD -->
            </div>
            {% endfor %}
        </div>
    </div>
</div>
{% endif %}

This approach only hides the slider, but still counts towards your Recommendation usage. For a few categories, this method works well.

However, if you have many categories with low amount of products, we recommend blocking the slider injection at the server level instead.