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
@starfelia
Copy link

Hello,
after using this code on top, related products started appearing but images are very large and 4 images appearing in 4 rows instead of one.
How can i resolve? Please help.
Thanks

@OhMarco
Copy link

OhMarco commented Aug 3, 2017

Hello guys, have the same problem using this code on Debut theme
"Liquid error: Could not find asset snippets/product-grid-item.liquid Liquid error: Could not find asset snippets/product-grid-item.liquid Liquid error: Could not find asset snippets/product-grid-item.liquid Liquid error: Could not find asset snippets/product-grid-item.liquid"

Is there anyone could help me to solve it?

@Farah-Anzimaty
Copy link

Hello everyone,
I used the code on my venture theme and it is working properly, but I need to have for each product its own related products.
i.e. for a product called pants, I need as related products a shirt and shoes that matches the pants.
Can you please advise what is the suitable code for that.
Thank you

@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