Skip to content

Instantly share code, notes, and snippets.

@kellyvaughn
Last active October 13, 2015 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kellyvaughn/0b8e7292b48d365e2697 to your computer and use it in GitHub Desktop.
Save kellyvaughn/0b8e7292b48d365e2697 to your computer and use it in GitHub Desktop.
Shopify Pagination ("Displaying X - Y of Z items (Page X of Y) / View All")
{% assign updated_count = paginate.current_offset | plus: paginate.page_size %}
<span class="nomobile">Displaying </span>
<span>
{{ paginate.current_offset | plus: 1 }}
{% if paginate.items < paginate.page_size %}
- {{ paginate.items }} of {{ paginate.items }}
{% else %}
-
{% if paginate.items > updated_count %}
{{ updated_count }}
{% else %}
{{ paginate.items }}
{% endif %}
of {{ paginate.items}}
{% endif %}
Products
<span class="nomobile">
(Page {{ paginate.current_page }} of {{ paginate.pages }})
</span> / </span><a href="?view=all">View All</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment