Choosing which Products to import on Magento 1

Control whether to show products that are out-of-stock, hidden, variants etc.

Showing out-of-stock products

If you want to also show products that are out of stock in your Clerk.io results, you can easily control this in the Magento backend.

Start by going to:

System -> Configuration -> CLERK -> Settings

Choose your Store View from the left menu, and go to Clerk Settings.

In here, set Include Out Of Stock Products to Yes and click Save Config:

Finally, go to my.clerk.io -> Data and click Start New Data Sync to import all products, including ones that are out-of-stock.

Advanced changes

In Magento, the following file controls which products are imported to Clerk.io:

app->code->community->Clerk->Clerk->Model->Productpage.php

The function load($page,$limit) is responsible for controlling the collection of products that are sent to Clerk.io. Per default, only products with visibility: both(Catalog, Search) which are also in stock, are imported.

This can be changed in the two following places:

If you change the products imported by Clerk.io, we strongly recommend that you also add an extra attribute which indicates when a product is not saleable or visible, so you can show it in your Design and you can filter on it.

Assuming you create an attribute called is_saleable which is either true or false, you can use it like this in Designs:

{% if product.is_saleable %}
   <div class="in-stock">In Stock</div>
{% else %}
  <div class="not-in-stock">Not In Stock</div>
{% endif %}

Finally, go to my.clerk.io -> Data and click Start New Data Sync to import your new data.