更改产品系列页面上显示的产品数量

通过更改模板编辑器中的模板设置或编辑您的模板代码,您可以更改产品系列页面上显示的产品数量。您可以按需显示任何数量的产品,只要不超过 Shopify 每页 50 个产品的限制即可。

检查您的模板设置

  1. 在更改模板代码之前,转到模板编辑器

  2. 在页面顶部的下拉菜单或在移动设备上的模板菜单中,选择产品系列页面

  3. 点击产品系列页面产品系列

  4. 如果您的模板具有可更改产品系列页面上显示的产品数量的设置,请调整该设置以满足您的需求。

  5. 点击保存

如果您的模板中没有用于更改每页显示的产品数量的设置,或者存在此类设置但对于您要执行的更改过于局限,请按照以下步骤编辑您的模板代码。

更新 collection-template.liquid 文件

  1. Sections 目录中,点击 collection-template.liquid

  2. 在代码编辑器中,查找以下代码:

 {% paginate collection.products by 9 %}
In the above example, the default number of products per page is 9. This number varies theme to theme. You will need to change this number to the number of products that you'd like to show on your collection pages. Use any number you like, as long as it is not more than 50.

Some themes use a variable called `limit` instead of a number to determine how many products will be shown per page. If your theme uses a `limit` variable, the code will look like this:
 {% paginate collection.products by limit %}
If your theme uses a `limit` variable, you will need to replace `limit` with a number. As above, this is the number of products that will show on each collection page, and the number must not be more than 50. Note that replacing the limit variable with a number will remove the ability to make changes to the collection pages [pagination](https://shopify.dev/themes/architecture/templates/collection) settings in the theme editor. We recommend that you not edit your theme code unless you are unable to achieve the desired number of products per page in the [theme editor](https://www.shopify.com/admin/themes/current/editor).
  1. 点击保存

更新 collection.liquid 文件

  1. Templates 目录中,点击 collection.liquid

  2. 在代码编辑器中,查找以下代码:

 {% paginate collection.products by 9 %}
In the above example, the default number of products per page is 9. This number varies theme to theme. You will need to change this number to the number of products that you'd like to show on your collection pages. Use any number you like, as long as it is not more than 50.

Some themes use a variable called `limit` instead of a number to determine how many products will be shown per page. If your theme uses a `limit` variable, the code will look like this:
 {% paginate collection.products by limit %}
If your theme uses a `limit` variable, you will need to replace `limit` with a number. As above, this is the number of products that will show on each collection page, and the number must not be more than 50. Note that replacing the limit variable with a number will remove the ability to make changes to the collection pages [pagination](https://shopify.dev/api/liquid/tags/theme-tags#paginate) settings from the theme editor. We recommend that you not edit your theme code unless you are unable to achieve the desired number of products per page from the [theme editor](https://www.shopify.com/admin/themes/current/editor).
  1. 点击保存

准备好开始使用 Shopify 进行销售了吗?

免费试用