Jump to content

How to prevent image cropping on product detail page on mobile devices.

Go to solution Solved by paul2009,

Recommended Posts

Site URL: https://www.cboothandson.co.uk/cigars/p/partagas-lusitanias-cigar

Hello,

I'm hoping someone can help with an issue I'm encountering regarding product images being cropped on mobile devices when viewing the product detail page.

As you can see on the URL, all of my product images are square. When viewing the product detail page on the desktop, they remain square.

However, when viewing a product detail page on mobile, there seems to be a vertical crop happening on either side of the product image which cuts off a part of the product. I have attached a screenshot of how the product detail page looks on desktop as well as on mobile so you can see an example of how the images are being cropped.

Does anyone have a piece of CSS I can insert which will keep the images square so my customer using mobile devices can see the full-sized product image instead of a cropped version?

Thank you in advance!

Image Cropping Issues.JPG

Image croppign Issue.png

Link to comment
  • Solution
On 1/18/2021 at 2:17 PM, Jordan-FIG said:

when viewing a product detail page on mobile, there seems to be a vertical crop happening on either side of the product image which cuts off a part of the product.

This appears to be a Squarespace bug and it would be worth reporting this to Squarespace Customer Care. It occurs when the Aspect Ratio is set to 1:1 and the Design is set to Carousel (in Design > Product Items).

In this configuration, the object-fit property is being changed on mobile resulting in the crop. Choosing different options will prevent this although a quick workaround may be to add the following to Design > Custom CSS. You'll need to save the changes and refresh the site before it will take effect.

.ProductItem-gallery-slides-item-image {
  object-fit: contain!important;
}

  If this helps you, please click "Like" below  ⬇️

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.
Catch up on all the release notes and announcements 2023 [for Circle members only] (there's a public version here)

Buy me a coffee

Link to comment
18 hours ago, paul2009 said:

This appears to be a Squarespace bug and it would be worth reporting this to Squarespace Customer Care. It occurs when the Aspect Ratio is set to 1:1 and the Design is set to Carousel (in Design > Product Items).

In this configuration, the object-fit property is being changed on mobile resulting in the crop. Choosing different options will prevent this although a quick workaround may be to add the following to Design > Custom CSS. You'll need to save the changes and refresh the site before it will take effect.


.ProductItem-gallery-slides-item-image {
  object-fit: contain!important;
}

  If this helps you, please click "Like" below  ⬇️

This worked perfectly, thank you @paul2009 .

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.