Add unless to product-card-grid.liquid to stop it from showing example products when over 50 pagination limit. Put this at top and bottom of file
```
\!h {% unless product.title == blank %}
{% endunless %}
```
Add this above pagination in collection-template.liquid section:
```
{% assign unsortedProducts = collection.products | reverse | reverse %}
{% comment %}
Yes I know, reverse | reverse looks redundant, but there does seem to be some value in getting an array out of the reverse filter instead of trying to use collection.products directly (avoids an error where concat complains that is needs an array argument), and since we don't want to actually change the order here, we have to reverse it back.
{% endcomment %}
{% for product in unsortedProducts %}
{% assign sliceIndex = forloop.index0 %}
{% assign aProduct = unsortedProducts | slice: sliceIndex, 1 %}
{% if product.available == true %}
{% if availableProducts.size == 0 %}
{% assign availableProducts = aProduct %}
{% else %}
{% assign availableProducts = availableProducts | concat:aProduct %}
{% endif %}
{% else %}
{% if unavailableProducts.size == 0 %}
{% assign unavailableProducts = aProduct %}
{% else %}
{% assign unavailableProducts = unavailableProducts | concat: aProduct %}
{% endif %}
{% endif %}
{% endfor %}
{% assign sortedProducts = collection.products %}
{% if unavailableProducts.size > 0 and availableProducts.size > 0 %}
{% assign sortedProducts = availableProducts | concat:unavailableProducts %}
{% endif %}
```
Replace include 'product-card-grid' in collection-template.liquid with:
{% assign sortedProductsIndex = paginate.current_offset | plus: forloop.index0 %}
{% include 'product-card-grid', product: sortedProducts[sortedProductsIndex], max_height: max_height %}