能否在Shopify中完成收集的用户分类系统?

能否在Shopify中完成收集的用户分类系统?,shopify,Shopify,在Shopify中,集合可以有默认的排序顺序,这非常好。但是,在呈现集合的产品列表之前,有没有办法更改默认的排序顺序?我试图实现的是在页面上放置一个按价格、品牌、畅销商品、字母顺序等排序的下拉菜单。就像许多现代购物车一样。收藏提前排序,而不是动态排序,以便页面可以更快地加载 您可以使用相同的产品创建多个集合,但排序不同。然后,您可以根据用户输入导航到相关集合。现在有一个用于此的应用程序: *免责声明-我是开发人员:我们最近添加了一种功能,在您只能在后端按一个顺序对集合进行排序之前,可以在店面上

在Shopify中,集合可以有默认的排序顺序,这非常好。但是,在呈现集合的产品列表之前,有没有办法更改默认的排序顺序?我试图实现的是在页面上放置一个按价格、品牌、畅销商品、字母顺序等排序的下拉菜单。就像许多现代购物车一样。

收藏提前排序,而不是动态排序,以便页面可以更快地加载


您可以使用相同的产品创建多个集合,但排序不同。然后,您可以根据用户输入导航到相关集合。

现在有一个用于此的应用程序:


*免责声明-我是开发人员:

我们最近添加了一种功能,在您只能在后端按一个顺序对集合进行排序之前,可以在店面上对集合进行动态排序

文件:

ex代码:

如果您想避免为应用付费-该应用可能会或可能不会按照所需的选择数量复制每个集合-请使用/调整以下代码:

  <script>
    // jquery is already running on the site, so we use it to check the document is ready
    $(document).ready(function() {
        // Identify a Select Option from the value in the URL query text
        // Where this exists as an Option Value, add the 'selected' attribute to the Option
        // This ensures that when the page reloads the current option will be showing
        $("#selectSort option[value='{{collection.sort_by}}']").attr('selected', true);
    });
  </script>

  <div>
    <!-- 
    The Select Tag watches for a change, then pushes a new window.location using the value
    of the Option selected by the user
    -->
    <select id="selectSort" onchange='window.location="{{ collection.url }}?sort_by=" + this.value'>
      <option value="price-ascending">Price (lowest first)</option>
      <option value="price-descending">Price (Highest first)</option>
      <option value="title-ascending">A-Z</option>
      <option value="title-descending">Z-A</option>
      <option value="created-descending">Latest Addition</option>
      <option value="best-selling">Most Popular</option>
    </select>
  </div>

我用这个技巧创建了一个排序机制,所以我会给你一个正确的答案。谢谢