Show more or less Related Items on Product pages
Note:
Groupthought does not provide any warranty or further support for this code. Use this code at your own risk. The code provided below is only a suggestion. You are responsible for any and all code customizations made to your theme. Please work with a developer or Shopify Expert to ensure proper customization. This code may not work with all versions of of Pipeline or with other code customizations and apps you may have installed. We strongly recommend that you make duplicate of your theme before adding or changing any code in your theme.
This tutorial is intended for use with the Pipeline theme.
You can adjust the number of related items to show with this modification:
- 1
-
Open product-related-items.liquid file
Open your Code Editor.
From your list of themes, find the Actions link for the theme you'd like to edit. Then select Edit code. Example draft theme:
Example if you're working from your main live/published theme:
Quick link if the theme is live/published:
Open Code Editor
In the Snippets folder, open product-related-items.liquid.
If Pipeline is published, you can use this quick link:
Quick link if the theme is live/published:
snippets/product-related-items
- 2
-
Change the break_at value
In the code area, use the Find feature (Command-F on Mac, Control-F in Windows) and search for the number "6" without quotes:
Change the value on this line, it's usually around Line 53:
The default is 6, change to 4 would show four items. For larger sized images, try 3 or even 2.
Show more than 6 related items?
If you want to show multiple rows, try a larger number like 12:
You can control how many per row with the value on this line:
In that case, if you have 12 and 4 per row, you'll have 3 rows of related items. Change that to value to 6 if you want to show 2 rows of 6 related items.
Remember to Save the file after your changes.