Product Image Aspect Ratio for 'Related Products'

Hi! I have managed to edit the code in order to get my images to show as a 1:1 ratio on the product page, however, this does not extend to the ‘Related Products’ section, which still has different sized images.

Is there a specific part of the code for related products?

Photo below for reference. If I change the Product Card Image Ratio to square it just crops the images and I don’t want it to do that.

Hey @ARnkn ,

Can you share the link to your store please? Thanks!

It’s not live yet, so here is the preview link

Hey @ARnkn ,

Go to your theme’s “Edit Code” Option, then in the search bar type “theme.liquid”
Below the tag “” tag paste the following. Screenshot attached for reference.


Screenshot is for reference only, the correct code to paste is the one shown above.

Amazing!! Thank you so much! You are an absolute life saver!

One problem, it has worked for the related products section…but weirdly enough its changed the images on the homepage on the carousel. See attached

Hey @ARnkn ,

You can replace the code with this and see if it works


So that’s worked for those images. But now having an issue with the product details being really far away from the photo and any images that are wider are being cropped.

See screen grabs (sorry to be such a pain)

Oh, I missed one part of the code.

Replace it with this and it should be fine.


That’s solved the text. But the split images is still happening, I think its only on products that have more than one image though, as single image products are fine.

Can you try incognito or something?

Looks fine to me

I’ve tried incognito, but its still showing, its not the items on the home page. If you go onto say the giraffe mini head and scroll down to the related items at the bottom.

Replace the code with this.


That’s fixed it :slightly_smiling_face:

One last one (i promise) and then I’ll buy you a coffee.

The images that are landscape are still getting cropped. The first two in the picture below are an example

Well, code can’t fix that. Landscape is not square, so you can’t just force it to be square. You have to upload square images.

Wishful thinking on my part. Thank you so much for all your help!! Will go and fix those images now

Thank you again for all your help with the above last week, unfortunately since going live the related product images don’t show up on an iphone (but they do on android and in the mobile view in ‘Customise’).

Could this be part of the code? or completely unrelated? Shopify Support are unable to help

Hey @ARnkn ,

Can you share the new link to your store?

Sure, its: https://www.fionawalkerengland.com/

Hey @ARnkn ,

There’s some extra code iPhones need. Just add this as well. Don’t need to replace anything, just add this below the . Same instructions as above.


You are a star :star: Thank you so much!