變更商品系列頁面上顯示的產品數量

若要變更商品系列頁面所顯示的產品數量,您可以在佈景主題編輯器中變更佈景主題設定,或編輯佈景主題程式碼。您要顯示多少產品都可以,只要不超過 Shopify 每頁 50 項產品的限制即可。

檢查佈景主題設定

  1. 變更佈景主題程式碼之前,請前往「佈景主題編輯器」。

  2. 在頁面最上方的下拉式選單或行動版的「範本」選單中,選取「商品系列頁面」。

  3. 點擊「商品系列頁面」或「商品系列」。

  4. 如果您的佈景主題有設定可變更商品系列頁面顯示的產品數量,請調整設定以滿足您的需求。

  5. 點擊「儲存」。

如果您的佈景主題沒有設定可變更每頁顯示的產品數量,或該設定存在但限制您想要進行的變更,請按照後續步驟編輯佈景主題程式碼。

更新 collection-template.liquid 檔案

  1. 「區段」目錄中,按一下 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. 在「範本」目錄中,按一下「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 銷售商品了嗎?

免費試用