We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Changing Image aspect ratio in Recently Viewed Products section

Changing Image aspect ratio in Recently Viewed Products section

SShrimpman
Shopify Partner
4 0 0

Hello guys, i have a problem here, my images in the Recently Viewed Products Section are always in the aspect Ratio "adapt" it's actually very easy to put the one i want that is square in here :

Captura de ecrã 2024-12-16 123711.png
the problem is, i want to be able to change it dynamically like i can do in other sections, creating the schema is pretty easy and it's already done:

Captura de ecrã 2024-12-16 123543.png

my problem now is that i can't pass the value of the variable i define in schema to this file, i duplicated all the files i use in this, those files are the recently-viewed-products.liquid, recently-viewed-products-ajax.liquid and recently-viewed.js, i even put defined the variable in my code and i see it's value in the website, can someone help?

Captura de ecrã 2024-12-16 124152.pngCaptura de ecrã 2024-12-16 124256.png

Replies 6 (6)

Hasan112
Shopify Partner
152 11 22

aspect-ratio: 1 / 1 !important;
object-fit: cover !important;

use this css

- If you need assistance with your store, feel free to contact us at zayan.1@yahoo.com or WhatsApp!
- Hire me, if you want to Design, Re-design, Develop a store or make changes to the pre-built store.
- If its helpful, please Mark as Accepted Solution, reply helpful? Click Like. Or Coffee Tip Thank you!
SShrimpman
Shopify Partner
4 0 0

as i said above, i could do it that way, but i don't want to do it like that, i want to be able to define it's aspect ratio by customize

Hasan112
Shopify Partner
152 11 22

The aspect ratio value on html but maybe do not have a aspect schema that's why you do not have a aspect setting option 

- If you need assistance with your store, feel free to contact us at zayan.1@yahoo.com or WhatsApp!
- Hire me, if you want to Design, Re-design, Develop a store or make changes to the pre-built store.
- If its helpful, please Mark as Accepted Solution, reply helpful? Click Like. Or Coffee Tip Thank you!
SShrimpman
Shopify Partner
4 0 0

i know it does not have the schema, i already looked at the code, but is it possible to create one? i tried to create one, passed the value as a select option and i can see the value when i console.log or display it in the html in the "recently-viewed-products.liquid", but the value does not reach the "recently-viewed-products-ajax.liquid" and this file is where the card is being rendered and has the aspect ratio defined

Hasan112
Shopify Partner
152 11 22

which theme are you using, its impossible to tell you like this way, sorry, i can't understand without code.

- If you need assistance with your store, feel free to contact us at zayan.1@yahoo.com or WhatsApp!
- Hire me, if you want to Design, Re-design, Develop a store or make changes to the pre-built store.
- If its helpful, please Mark as Accepted Solution, reply helpful? Click Like. Or Coffee Tip Thank you!
SShrimpman
Shopify Partner
4 0 0

I am using the Woodstock theme