Nomisneerg Posted January 18, 2021 Share Posted January 18, 2021 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! Link to comment
Solution paul2009 Posted January 19, 2021 Solution Share Posted January 19, 2021 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 ⬇️ Nomisneerg 1 Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional. Would you like your customers to be able to mark their favourite products in your Squarespace store? Link to comment
Nomisneerg Posted January 20, 2021 Author Share Posted January 20, 2021 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
Yorgos Posted December 8, 2023 Share Posted December 8, 2023 Hi there, unfortunately I face the same problem. After I apply the code it seems to be correctet, but when I refresh the page the product pictures are cropped on the mobile version of the product pages. Any clue about how to solve it? Best, Yorgos Link to comment
Bilash Posted December 8, 2023 Share Posted December 8, 2023 Hi @Yorgos Is it possible for you to share your page URL? Yorgos 1 🙋♂️ Taifuzzaman Bilash - LinkedIn | WhatsApp | Email -- Set up a free discovery meeting -- I'm available for hire on Upwork. Link to comment
Yorgos Posted December 9, 2023 Share Posted December 9, 2023 (edited) Hi @Bilash, Yes, ofcourse. Here it is: https://www.yorgoslaios.com/shop. You can find also a screenshot from my mobile device. Edited December 9, 2023 by Yorgos Link to comment
tuanphan Posted December 11, 2023 Share Posted December 11, 2023 On 12/9/2023 at 5:08 PM, Yorgos said: Hi @Bilash, Yes, ofcourse. Here it is: https://www.yorgoslaios.com/shop. You can find also a screenshot from my mobile device. Add this to Website Tools (under Not Linked) > Custom CSS img.ProductItem-gallery-slides-item-image { object-fit: contain !important; } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Bilash Posted December 11, 2023 Share Posted December 11, 2023 Hi @Yorgos Your image looks fine on my mobile and desktop devices though. 🙋♂️ Taifuzzaman Bilash - LinkedIn | WhatsApp | Email -- Set up a free discovery meeting -- I'm available for hire on Upwork. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment