Rediger antallet af produkter, der vises på kollektionssiderne

Du kan ændre antallet af produkter, der vises på dine kollektionssider ved at foretage ændringer af dit temas indstillinger i temaeditoren eller ved at redigere dit temas kode. Du kan vise lige så mange produkter, som du vil, så længe du ikke overstiger Shopifys grænse på 50 produkter pr. side.

Tjek dine temaindstillinger

  1. Åbn din Temaeditor, før du foretager ændringer af dit temas kode.

  2. Vælg Kollektionssider i rullemenuen øverst på siden eller i menuen Skabeloner på mobil.

  3. Klik på Kollektionssider eller Kollektion.

  4. Hvis dit tema har indstillinger til redigering af det antal produkter, der vises på dine kollektionssider, kan du justere indstillingerne efter dine behov.

  5. Klik på Gem.

Hvis dit tema ikke har indstillinger til redigering af det antal produkter, der vises på hver side, eller hvis indstillingerne findes, men er for begrænsede i forhold til de ønskede ændringer, skal du følge de næste trin for at redigere temaets kode.

Opdater filen collection-template.liquid

  1. Klik på collection-template.liquid i mappen Afsnit.

  2. Find følgende kode i kodeeditoren:

 {% 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. Klik på Gem.

Opdater filen collection.liquid

  1. Klik på collection.liquid i mappen Skabeloner.

  2. Find følgende kode i kodeeditoren:

 {% 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. Klik på Gem.

Er du klar til at begynde at sælge med Shopify?

Prøv det gratis