Skip to content

Instantly share code, notes, and snippets.

@carolineschnapp
Last active December 22, 2022 21:29
Show Gist options
  • Save carolineschnapp/1002801 to your computer and use it in GitHub Desktop.
Save carolineschnapp/1002801 to your computer and use it in GitHub Desktop.
Related Products — to add to product.liquid
@amitaroradelhi
Copy link

amitaroradelhi commented Aug 21, 2017

I used the code on my Shopify Debut theme but Related Products instead of coming in a row coming in column, and the image size is too big. How to fix it?

@crownedathletics
Copy link

I was able to center the title text on the page, but the items and the horizontal line above the text are still aligned to the left. Can anyone help please?! Thanks!

@minhbt
Copy link

minhbt commented Oct 13, 2017

please check this source
{% capture related_items %} {% for product in collection.products %}

You just got maximum 50 products only... Do you have solution to get all products of collection?

@Chrisbambi
Copy link

Hi,

I have Supply theme and the Heading ({% assign heading = 'Other fine products' %}) cuts off on the left hand side of my mobile website, as well as the related products on the left-hand side.
It will read something like 'ther fine products', with the 'O' and part of the 't' cut off.
Is there a way to fix this?

@ParanormalMike
Copy link

Hello i have a issue with related-products.liquid file i created in my shopify store.

i have use the follow method to create related products section

https://help.shopify.com/themes/customi ... d-products

The code i pasted into my store's related-products.liquid file is the follow

https://gist.githubusercontent.com/sadi ... ts.liquid#

Although I have set it to show 4 items on a row (1 row) but that i can see is 4 items vertical. For mobile devices looks ok but on the desktop no.

Can you help me to with the code to make my related products on a row and not vertical ? Thank you in advance

@hyungjoo87
Copy link

Hi Caroline,

I was wondering if this would work with the current theme I have?

www.shopskiesareblue.com

Thank you

@max2524
Copy link

max2524 commented Apr 13, 2018

work for booklyn theme in my site https://www.malldallas.com/products/2018-new-women-cat-eye-sunglasses
. thank you for your code

@xto3na
Copy link

xto3na commented Dec 13, 2018

Hello, Caroline!
Thank You! All works for me.
But in your code(line 109: "<h2 class="section-header__title">{{ heading }}</h1>"), opening tag - h2, closing tag - h1.

@smitsanghvi21
Copy link

How do I recommend products just for a particular collection? For example my site has collections tv, mobile ,etc. But I want to recommend similar products just in mobile collections and not recommend products in other collections. How do I do this?

@luismanuelvivas
Copy link

Thanks it works perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment