Project portfolio Browse selected work

Shopify Plus Upgrade Monthly Fee Reduction + Up to $4800 Development Fee Credit - Exclusive WesWoo Offer

Developer modules / Collection selection and comparison

Collection selection and comparison

Define real distinctions before implementing filters, results and model comparison.

Product grids, sorting and pagination

Keep the collection introduction and render filtered results through one card. Native pagination keeps results reachable. Sorting should retain filters and operate beyond the current screen.

Data and dependencies

  • collection.products and the product-card dependency.
  • Use collection.sort_options and submit with current filters.

Interaction logic

  • Provide a recovery route when no items match.
  • Render the correct products and usable pagination.
Example code · snippets/ww-collection-grid.liquid
Liquid · WESWOO
<h1>{{ collection.title | escape }}</h1>
<div>{{ collection.description }}</div>
{% paginate collection.products by 24 %}
  <ul class="ww-product-grid">
    {% for product in collection.products %}
      <li>{% render 'ww-product-card', product: product %}</li>
    {% else %}
      <li>No matching products. Change or clear the filters.</li>
    {% endfor %}
  </ul>
  {{ paginate | default_pagination }}
{% endpaginate %}

Example code · snippets/ww-product-card.liquid
Liquid · WESWOO
{% assign card_product = product %}
{% assign card_variant = card_product.selected_or_first_available_variant %}
{% assign card_form_id = 'CardProduct-' | append: section.id | append: '-' | append: card_product.id %}
<article>
  <a href="{{ card_product.url | escape }}">
    {% if card_product.featured_image %}
      {{ card_product.featured_image | image_url: width: 640 | image_tag: widths: '320, 480, 640', sizes: '(max-width: 749px) 45vw, 25vw', loading: 'lazy' }}
    {% endif %}
    <h3>{{ card_product.title | escape }}</h3>
  </a>
  <p>{{ card_product.metafields.custom.key_spec.value | escape }}</p>
  <p>{{ card_variant.price | money_with_currency }}</p>
  {% if card_product.has_only_default_variant and card_variant.available %}
    {% form 'product', card_product, id: card_form_id %}
      <input type="hidden" name="id" value="{{ card_variant.id }}">
      <button type="submit">Add to cart</button>
    {% endform %}
  {% else %}
    <a href="{{ card_product.url | escape }}">Choose options and check availability</a>
  {% endif %}
</article>

Example code · assets/ww-module-layout.css
CSS · WESWOO
.ww-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  list-style: none;
  padding: 0;
}
.ww-product-grid img { width: 100%; height: auto; }
.ww-product-grid h3 { overflow-wrap: anywhere; }
.ww-table-scroll { max-width: 100%; overflow-x: auto; }
.ww-table-scroll table { border-collapse: collapse; min-width: 30rem; }
.ww-table-scroll th, .ww-table-scroll td { padding: .75rem; text-align: start; }
@media (max-width: 749px) {
  .ww-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
}

Acceptance checks

  • Navigate to the last page and back.
  • Check sorting/filter combinations and card prices.

The example depends on ww-product-card. Use the theme grid and integrate sorting into the filter form.

Read it, integrate it, verify it

  1. Choose a module and confirm the data contract.
  2. Connect the fragment to the current theme or framework.
  3. Check real variants, markets and recovery states.

Examples target Shopify Online Store 2.0 themes. Headless has separate data and version boundaries. Integrate fragments with actual fields, theme components and locale files.

Architecture references

Original educational examples with Shopify documentation and pinned upstream references. Follow the applicable license when adopting repository code.

Shopify/dawn · Licensecommit 3e9ee2281dc4 · Shopify-integration theme license; architecture reference without copying the implementation.
Shopify/hydrogen · Licensecommit 9e358a2462ba · MIT; retain copyright and license when using substantial code.

References checked 2026-11-12